/* ================================================
   TABBED LAYOUT - Modern No-Scroll Design
   ================================================ */

/* Reset old styles */
.mobile-header,
.feature-dock,
.demo-banner,
.sidebar,
.sidebar-overlay,
.quick-features,
.game-layout {
    display: none !important;
}

/* Body & Container */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    background: linear-gradient(135deg, #2d572c 0%, #4CAF50 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 600;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
}

.resources-bar {
    display: flex;
    gap: 15px;
}

.resource-item-top {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sanctuary-level-top {
    background: rgba(255, 215, 0, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game Container - No Scroll, Fixed Height */
.game-container {
    height: calc(100vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
}

/* Panda Section */
.panda-section {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    height: 180px;
    flex-shrink: 0;
}

.time-weather {
    position: absolute;
    top: 10px;
    left: 15px;
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: #333;
}

.panda-level-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.panda-container {
    width: 120px;
    height: 120px;
    margin: 15px auto 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.panda-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

/* XP Bar */
.xp-bar-wrapper {
    flex-shrink: 0;
}

.xp-bar-container {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.xp-bar-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    transition: width 0.3s;
}

.xp-text {
    text-align: center;
    font-size: 0.8rem;
    color: white;
    margin-top: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Stats Panel - Compact Horizontal */
.stats-panel-compact {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.stat-compact {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    min-width: 0;
}

.stat-compact > span:first-child {
    font-size: 1.3rem;
}

.stat-label-text {
    font-weight: 600;
    color: #333;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
}

.stat-bar-mini {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    transition: width 0.3s;
}

.hunger-bar { background: linear-gradient(90deg, #FF6B6B, #FF8E53); }
.happiness-bar { background: linear-gradient(90deg, #FFD93D, #FFC947); }
.energy-bar { background: linear-gradient(90deg, #4ECDC4, #44A08D); }
.cleanliness-bar { background: linear-gradient(90deg, #6C5CE7, #A29BFE); }

/* Core Actions */
.core-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn-new {
    flex: 1;
    background: white;
    border: none;
    border-radius: 12px;
    padding: 12px 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-icon-big {
    font-size: 1.8rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 15px;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 5px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn span:first-child {
    font-size: 1.3rem;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Tab Content Area */
.tab-content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
}

.tab-content.active {
    display: block;
}

/* Tab Grid Layout */
.tab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.tab-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.card-icon {
    font-size: 2.5rem;
}

.card-title {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}

.card-desc {
    font-size: 0.8rem;
    color: #666;
}

/* Panda Grid */
.panda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.panda-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.panda-card:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.panda-card.active {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Scrollbar Styling */
.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        height: 100vh;
        overflow: hidden;
    }

    .top-bar {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .logo {
        font-size: 0.9rem;
    }

    .resources-bar {
        gap: 6px;
    }

    .resource-item-top {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .sanctuary-level-top {
        padding: 3px 8px;
        font-size: 0.75rem;
    }

    .game-container {
        height: calc(100vh - 45px);
        padding: 8px;
        gap: 6px;
    }

    .panda-section {
        height: 140px;
        padding: 10px;
    }

    .panda-container {
        width: 90px;
        height: 90px;
        font-size: 45px;
        margin: 10px auto 5px;
    }

    .panda-name {
        font-size: 0.95rem;
    }

    .xp-bar-wrapper {
        margin: 0;
    }

    .xp-text {
        font-size: 0.7rem;
    }

    /* Stats - stack vertically on very small screens */
    .stats-panel-compact {
        gap: 6px;
    }

    .stat-compact {
        padding: 8px 4px;
    }

    .stat-compact > span:first-child {
        font-size: 1.1rem;
    }

    .stat-label-text {
        font-size: 0.65rem;
    }

    /* Core actions - smaller buttons */
    .core-actions {
        gap: 6px;
    }

    .action-btn-new {
        padding: 10px 4px;
        font-size: 0.75rem;
    }

    .btn-icon-big {
        font-size: 1.5rem;
    }

    /* Tab nav - smaller */
    .tab-nav {
        gap: 4px;
        padding: 4px;
    }

    .tab-btn {
        padding: 8px 4px;
        font-size: 0.65rem;
    }

    .tab-btn span:first-child {
        font-size: 1.1rem;
    }

    /* Tab content */
    .tab-content {
        padding: 8px;
    }

    .tab-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .tab-card {
        padding: 15px 10px;
    }

    .card-icon {
        font-size: 1.8rem;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .card-desc {
        font-size: 0.7rem;
    }

    .panda-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 8px;
    }

    .btn-primary {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 400px) {
    .panda-section {
        height: 120px;
    }

    .panda-container {
        width: 75px;
        height: 75px;
        font-size: 38px;
    }

    .stat-compact {
        padding: 6px 3px;
    }

    .action-btn-new {
        padding: 8px 3px;
        font-size: 0.7rem;
    }

    .btn-icon-big {
        font-size: 1.3rem;
    }
}
