/* ========================================
   PROFILE PAGE STYLES
   Art Deco / Prohibition Era Theme
   ======================================== */

:root {
    --gold: #D4A574;
    --dark-gold: #B8860B;
    --deep-brown: #2C1810;
    --rich-burgundy: #4A1C1C;
    --cream: #F5E6D3;
    --bronze: #CD7F32;
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(212, 165, 116, 0.4);
}

body {
    font-family: 'Raleway', sans-serif;
    background: linear-gradient(135deg, #1a1410 0%, #2c2420 100%);
    color: var(--cream);
    min-height: 100vh;
}

/* ========================================
   PROFILE CONTAINER
   ======================================== */

.profile-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    min-height: calc(100vh - 100px);
}

/* ========================================
   LEFT SIDEBAR
   ======================================== */

@media (max-width: 768px) {
    .profile-main {
        padding: 20px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .achievements-grid,
    .stats-detailed,
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    /* Prevent any content from overflowing */
    .profile-section > * {
        max-width: 100%;
        overflow-x: auto;
    }
}

.profile-sidebar {
    background: linear-gradient(180deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px var(--shadow);
    position: sticky;
    top: 80px;
    height: fit-content;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--gold);
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    background: linear-gradient(135deg, var(--bronze) 0%, var(--dark-gold) 100%);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: bold;
    color: var(--deep-brown);
    box-shadow: 0 4px 20px var(--glow);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 20px var(--glow); }
    50% { box-shadow: 0 4px 30px rgba(212, 165, 116, 0.6); }
}

.rank-title {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.level-display {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: var(--cream);
    opacity: 0.9;
}

/* Profile Navigation */
.profile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-nav-item {
    margin-bottom: 8px;
}

.profile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    color: var(--cream);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
}

.profile-nav-link:hover:not(.disabled) {
    background: rgba(212, 165, 116, 0.1);
    border-color: var(--gold);
    transform: translateX(5px);
}

.profile-nav-link.active {
    background: linear-gradient(90deg, var(--gold) 0%, var(--bronze) 100%);
    color: var(--deep-brown);
    border-color: var(--dark-gold);
    box-shadow: 0 4px 12px var(--glow);
}

/* Override hover on active links */
.profile-nav-link.active:hover {
    background: linear-gradient(90deg, var(--gold) 0%, var(--bronze) 100%);
    color: var(--deep-brown);
}

.profile-nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coming-soon {
    font-size: 11px;
    background: var(--bronze);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.profile-main {
    background: rgba(44, 24, 16, 0.6);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px var(--shadow);
    backdrop-filter: blur(10px);
}

.profile-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.profile-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 10px;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 15px;
}

.section-description {
    color: var(--cream);
    opacity: 0.8;
    margin-bottom: 30px;
}

/* ========================================
   OVERVIEW SECTION - RANK SHOWCASE
   ======================================== */

.rank-showcase {
    text-align: center;
    margin-bottom: 40px;
}

.rank-artwork-container {
    width: 100%;
    max-width: 600px;
    height: 480px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #3a2820 0%, #5a3820 50%, #3a2820 100%);
    border: 4px solid var(--gold);
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(212, 165, 116, 0.1);
    overflow: hidden;
    position: relative;
}

/* Remove the old shimmer, add bubble animation */
@keyframes bubbleRise {
    0% {
        bottom: 15%;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateX(10px) scale(1);
    }
    100% {
        bottom: 90%;
        opacity: 0;
        transform: translateX(-10px) scale(0.8);
    }
}

.rank-artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    position: relative;
    z-index: 1;
}

.rank-artwork-container:hover .rank-artwork {
    transform: scale(1.05);
}

.rank-title-large {
    font-family: 'Cinzel', serif;
    font-size: 48px;
    color: var(--gold);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.level-info {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: var(--cream);
    margin-bottom: 30px;
}

/* XP Progress Bar */
.xp-progress {
    max-width: 700px;
    margin: 0 auto 40px;
}

.xp-bar-container {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--gold);
    border-radius: 30px;
    height: 45px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bronze) 0%, var(--gold) 50%, var(--dark-gold) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
    box-shadow: 0 0 20px var(--glow);
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.xp-percentage {
    font-weight: 700;
    color: var(--deep-brown);
    font-size: 18px;
}

.xp-text {
    text-align: center;
    font-size: 18px;
    color: var(--cream);
    font-weight: 600;
}

/* ========================================
   STAT CARDS
   ======================================== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--glow);
}

.stat-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--cream);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   RECENT ACHIEVEMENTS
   ======================================== */

.recent-achievements {
    background: rgba(74, 28, 28, 0.3);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 25px;
}

.recent-achievements h2 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid var(--gold);
    transition: transform 0.2s ease;
}

.achievement-item:hover {
    transform: translateX(5px);
    background: rgba(0, 0, 0, 0.3);
}

.achievement-icon {
    font-size: 32px;
    min-width: 40px;
    text-align: center;
}

.achievement-text {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 3px;
    font-size: 16px;
}

.achievement-desc {
    font-size: 14px;
    opacity: 0.8;
}

/* ========================================
   ACHIEVEMENTS SECTION
   ======================================== */

.achievements-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-chip {
    padding: 10px 20px;
    border: 2px solid var(--gold);
    background: transparent;
    color: var(--cream);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    background: rgba(212, 165, 116, 0.1);
}

.filter-chip.active {
    background: var(--gold);
    color: var(--deep-brown);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.achievement-badge {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.achievement-badge:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--glow);
}

.achievement-badge.locked {
    opacity: 0.5;
    border-color: #666;
}

.achievement-badge-icon {
    font-size: 64px;
    margin-bottom: 10px;
}

.achievement-badge-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--gold);
    margin-bottom: 5px;
}

.achievement-badge-desc {
    font-size: 14px;
    opacity: 0.8;
}

/* ========================================
   STATS SECTION
   ======================================== */

.stats-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stats-card {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 25px;
}

.stats-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    color: var(--gold);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    color: var(--cream);
    opacity: 0.8;
}

.stat-row strong {
    color: var(--gold);
    font-weight: 700;
}

/* ========================================
   FAVORITE BEERS SECTION
   ======================================== */

.favorite-beers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.favorite-beer-card {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease;
}

.favorite-beer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--glow);
}

.beer-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--gold);
    margin-bottom: 10px;
}

.beer-stats {
    font-size: 14px;
    opacity: 0.8;
}

/* ========================================
   LEADERBOARDS SECTION
   ======================================== */

.leaderboard-rankings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ranking-card {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.ranking-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--glow);
}

.ranking-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 15px;
}

.rank-position {
    font-family: 'Cinzel', serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 5px;
}

.rank-label {
    font-size: 14px;
    opacity: 0.8;
    text-transform: uppercase;
}

.view-full-leaderboards {
    display: inline-block;
    padding: 15px 30px;
    background: var(--gold);
    color: var(--deep-brown);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.view-full-leaderboards:hover {
    background: var(--dark-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow);
}

/* ========================================
   COMING SOON MESSAGE
   ======================================== */

.coming-soon-message {
    text-align: center;
    padding: 60px 20px;
}

.coming-soon-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.coming-soon-message h3 {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 15px;
}

.coming-soon-message p {
    font-size: 18px;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   SETTINGS SECTION
   ======================================== */

.settings-card {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.settings-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

.settings-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gold);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gold);
    background: rgba(0, 0, 0, 0.3);
    color: var(--cream);
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--dark-gold);
    box-shadow: 0 0 10px var(--glow);
}

.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.btn-primary {
    padding: 12px 30px;
    background: var(--gold);
    color: var(--deep-brown);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--dark-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--glow);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.loading, .no-data {
    text-align: center;
    padding: 40px;
    color: var(--cream);
    opacity: 0.6;
    font-style: italic;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .profile-container {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .profile-main {
        padding: 20px;
    }

    .rank-title-large {
        font-size: 32px;
    }

    .rank-artwork-container {
        height: 350px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* Favorite Beers Styling */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.favorite-beer-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease;
}

.favorite-beer-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--glow);
}

.favorite-position {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
    min-width: 50px;
}

.favorite-beer-info {
    flex: 1;
}

.remove-favorite-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s ease;
}

.remove-favorite-btn:hover {
    background: #dc3545;
}

.no-favorites {
    text-align: center;
    padding: 40px 20px;
}

/* Favorites Grid - 3 Slots */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Mobile fix for favorites */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: 1fr; /* ✅ Single column on mobile */
        gap: 15px;
    }
    
    .favorite-slot {
        min-height: 150px; /* Slightly shorter on mobile */
    }
}

.favorite-slot {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 25px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.favorite-slot.filled:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--glow);
}

.slot-number {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.favorite-slot.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    border-style: dashed;
}

.add-favorite-btn {
    padding: 15px 30px;
    background: var(--gold);
    color: var(--deep-brown);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-favorite-btn:hover {
    background: var(--dark-gold);
    transform: scale(1.05);
}

.favorite-beer-info {
    flex: 1;
    margin-bottom: 15px;
}

.remove-favorite-btn {
    align-self: flex-end;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s ease;
}

.remove-favorite-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.favorite-hint {
    text-align: center;
    font-style: italic;
    opacity: 0.7;
    margin-top: 10px;
}

/* Favorite Modal Styling */
.favorite-modal-content {
    background: linear-gradient(135deg, var(--rich-burgundy) 0%, var(--deep-brown) 100%) !important;
    border: 3px solid var(--gold) !important;
    color: var(--cream) !important;
}

.favorite-modal-content .close {
    color: var(--gold) !important;
    font-size: 40px !important;
    font-weight: bold !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.favorite-modal-content .close:hover {
    background: rgba(212, 165, 116, 0.3);
    transform: scale(1.1);
}

.favorite-modal-content h2 {
    color: var(--gold) !important;
    font-family: 'Cinzel', serif !important;
}

.favorite-modal-content p {
    color: var(--cream) !important;
}

.beer-search-result {
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
    border-radius: 8px;
}

.beer-search-result:hover {
    background: rgba(212, 165, 116, 0.2) !important;
}