/* assets/css/newplayercompact.css - Updated Version */

/* ตัวแปรสำหรับธีมกระชับ */
:root {
    --npc-item-border: #ff7e00;
    --npc-item-glow: rgba(255, 126, 0, 0.4);
    --npc-item-bg: rgba(37, 37, 37, 0.95);
    --npc-item-hover-bg: rgba(37, 37, 37, 1);
    --npc-item-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    --npc-item-hover-shadow: 0 6px 15px rgba(255, 126, 0, 0.5);
}

/* การตั้งค่าหลัก */
body {
    overflow-x: hidden;
    min-height: 100vh;
}

main {
    min-height: calc(100vh - 100px);
    overflow: visible;
}

.container-fluid {
    min-height: 100%;
    padding: 10px;
}

/* Header กระชับ */
.new-player-header {
    padding: 8px 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.new-player-header h1 {
    font-size: 1.4rem;
    margin: 0;
    display: inline-flex;
    align-items: center;
    background: linear-gradient(45deg, var(--np-accent), var(--np-accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.period-info {
    font-size: 0.9rem;
    color: var(--np-text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 126, 0, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 126, 0, 0.3);
}

/* Content Wrapper - กรอบใหญ่รวมทุกอย่าง */
.content-wrapper {
    background: rgba(26, 26, 26, 0.9);
    border: 2px solid var(--np-border);
    border-radius: var(--np-radius);
    padding: 20px;
    margin: 0 auto 15px auto; /* จัดกลาง */
    position: relative;
    max-width: 1200px; /* กำหนดความกว้างสูงสุด */
}

/* Main Container - แบ่งเป็นซ้าย-ขวา */
.main-container {
    display: flex;
    gap: 30px;
    align-items: start;
    justify-content: center; /* จัดกลางทั้งหมด */
    flex-wrap: wrap;
}

/* ส่วนไอเทม (ซ้าย) */
.items-section {
    margin-bottom: 0;
    flex: 0 1 700px; /* กำหนดขนาดสูงสุดและให้ยืดหยุ่นได้ */
}

/* Grid ไอเทม - 2 คอลัมน์ x 3 แถว */
.items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; /* เพิ่ม gap */
    max-width: 700px; /* เพิ่มความกว้าง */
    margin: 0;
}

/* Side Rewards Section - กรอบรางวัลด้านขวา */
.side-rewards-section {
    background: rgba(37, 37, 37, 0.5);
    border: 1px solid rgba(255, 126, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 0 0 350px; /* กำหนดขนาดคงที่ */
}

/* Reward Box */
.reward-box {
    padding: 0;
}

.reward-box + .reward-box {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 126, 0, 0.2);
}

/* Section Title */
.section-title {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--np-accent);
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 126, 0, 0.2);
    font-weight: 600;
}

/* การ์ดไอเทม - ขนาดใหญ่ขึ้น */
.item-card {
    background: var(--npc-item-bg);
    border: 2px solid var(--npc-item-border);
    border-radius: 12px;
    padding: 15px; /* เพิ่ม padding */
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: var(--npc-item-shadow);
    overflow: hidden;
    aspect-ratio: 1;
    min-height: 180px; /* กำหนดความสูงขั้นต่ำ */
}

/* เอฟเฟกต์แสงรอบกรอบ */
.item-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--npc-item-border), 
        transparent, 
        var(--npc-item-border), 
        transparent,
        var(--npc-item-border)
    );
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.item-card:hover::before {
    opacity: 1;
    animation: rotateGlow 3s linear infinite;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.item-card:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: var(--np-accent-hover);
    box-shadow: var(--npc-item-hover-shadow);
    background: var(--npc-item-hover-bg);
    z-index: 10;
}

/* ป้ายมุมสำหรับระยะเวลา */
.item-card .reward-days {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 126, 0, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem; /* ปรับขนาดให้พอดี */
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ไอคอนไอเทม - ขนาดใหญ่ขึ้น */
.item-card .reward-icon {
    width: 100%;
    height: auto;
    max-width: 140px; /* เพิ่มขนาด */
    margin: 0 auto 8px;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card .reward-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.item-card:hover .reward-icon img {
    transform: scale(1.1);
}

/* ชื่อไอเทม */
.item-card .reward-name {
    font-size: 0.95rem; /* เพิ่มขนาด */
    font-weight: 600;
    color: var(--np-accent);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 5px;
    line-height: 1.2;
    padding: 0 5px;
}

/* เงินสดและพ้อยท์ */
.cash-point-container {
    background: linear-gradient(135deg, rgba(37, 37, 37, 0.9), rgba(26, 26, 26, 0.9));
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid rgba(255, 126, 0, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.value-item {
    text-align: center;
    flex: 1;
}

.value-item .icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.value-item.cash .icon {
    color: var(--np-cash);
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.value-item.point .icon {
    color: var(--np-point);
    text-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.value-item .label {
    font-size: 0.85rem;
    color: var(--np-text-secondary);
    margin-bottom: 3px;
}

.value-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

/* ตัวคั่น */
.divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--np-border), 
        transparent
    );
}

/* Coins Grid - 4 เหรียญแสดงแบบ 2x2 */
.coins-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* เหรียญ */
.coin-item {
    background: linear-gradient(135deg, rgba(37, 37, 37, 0.9), rgba(26, 26, 26, 0.9));
    border: 1px solid var(--np-border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.coin-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.coin-item:hover::before {
    opacity: 1;
}

.coin-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    border-color: var(--np-accent);
}

.coin-item .coin-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.coin-item.gold .coin-icon {
    color: var(--np-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.coin-item.silver .coin-icon {
    color: var(--np-silver);
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.6);
}

.coin-item.bronze .coin-icon {
    color: var(--np-bronze);
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.6);
}

.coin-item.special .coin-icon {
    color: var(--np-special);
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

.coin-item .coin-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.2;
}

.coin-item .coin-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--np-accent);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    
    .items-section {
        width: 100%;
        max-width: 700px;
    }
    
    .side-rewards-section {
        width: 100%;
        max-width: 700px; /* ให้เท่ากับ items-grid */
        margin: 0 auto;
        flex-direction: row;
        gap: 20px;
        flex: 1 1 auto;
    }
    
    .reward-box {
        flex: 1;
    }
    
    .reward-box + .reward-box {
        padding-top: 0;
        padding-left: 20px;
        border-top: none;
        border-left: 1px solid rgba(255, 126, 0, 0.2);
    }
    
    .items-grid {
        max-width: 700px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px;
    }
    
    .main-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .side-rewards-section {
        flex-direction: column;
        padding: 15px;
    }
    
    .reward-box + .reward-box {
        padding-left: 0;
        padding-top: 20px;
        border-left: none;
        border-top: 1px solid rgba(255, 126, 0, 0.2);
    }
    
    .period-info {
        font-size: 0.85rem;
    }
    
    .items-grid {
        gap: 10px;
        max-width: 600px; /* ปรับขนาดสำหรับแท็บเล็ต */
    }
    
    .item-card {
        min-height: 160px; /* ลดขนาดสำหรับหน้าจอเล็ก */
    }
}

@media (max-width: 480px) {
    .new-player-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .items-grid {
        max-width: 400px; /* ปรับขนาดสำหรับมือถือ */
        gap: 8px;
    }
    
    .item-card {
        padding: 10px;
        min-height: 140px; /* ลดขนาดสำหรับมือถือ */
    }
    
    .item-card .reward-icon {
        max-width: 120px; /* ปรับขนาดสำหรับมือถือ */
    }
    
    .item-card .reward-name {
        font-size: 0.85rem;
    }
    
    .coins-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .coin-item {
        padding: 8px;
    }
    
    .coin-item .coin-icon {
        font-size: 1.3rem;
    }
    
    .coin-item .coin-name {
        font-size: 0.75rem;
    }
    
    .coin-item .coin-amount {
        font-size: 1rem;
    }
}

/* Animation เพิ่มเติม */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 126, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 126, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 126, 0, 0);
    }
}

.item-card:hover {
    animation: pulse 2s infinite;
}