:root {
    --primary: #FF2E63;
    /* Vibrant Pink */
    --secondary: #08D9D6;
    /* Neon Cyan */
    --dark: #252A34;
    /* Dark Blue-Grey */
    --light: #EAEAEA;
    /* Soft White */
    --gradient: linear-gradient(135deg, #FF2E63 0%, #08D9D6 100%);
    --font-main: 'Outfit', sans-serif;
    --accent: #FFD700;
    /* Gold for badges */
}

* {
    box-sizing: border-box;
}

html, body {
    background-color: var(--dark);
    color: var(--light);
    font-family: var(--font-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

/* Navbar */
.navbar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(37, 42, 52, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: transparent;
    border: none;
    gap: 5px;
    z-index: 101;
}

    .nav-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s;
        z-index: 99;
        display: none;
    }
.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--light);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Active State for Hamburger */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(37, 42, 52, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: transform 0.3s ease-in-out, visibility 0.3s;
        transform: translateX(100%);
        visibility: hidden;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        z-index: 100;
        gap: 2rem;
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-backdrop {
        display: block;
    }

    .nav-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        margin-left: 0;
        font-size: 1.5rem;
    }
}

/* Main Container */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Photo Card */
.photo-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 1rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.photo-container {
    position: relative;
    width: 100%;
    height: 500px;
    /* Fixed height for consistency */
    border-radius: 15px;
    overflow: hidden;
    background: #000;
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changed from cover to contain for better visibility */
    transition: transform 0.5s ease;
}

/* Roast Styles */
.roast-container {
    padding: 1rem 0.5rem;
    margin-top: 0.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.roast-text {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--secondary);
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

.buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none !important;
    text-align: center;
}

.btn-shot {
    background: var(--secondary);
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(8, 217, 214, 0.3);
}

.btn-shot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 217, 214, 0.5);
}

.btn-not {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 46, 99, 0.3);
}

.btn-not:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 46, 99, 0.5);
}

a.btn {
    text-decoration: none;
    display: inline-block;
    /* Ensure it treats padding correctly */
    box-sizing: border-box;
    /* Include padding in width */
    line-height: normal;
    /* Reset line height */
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Upload Form */
.upload-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    /* Increased gap */
    flex-direction: column;
    margin-top: 2rem;
}

/* Upload Zone */
.upload-zone {
    width: 100%;
    height: 300px;
    border: 3px dashed var(--secondary);
    /* Made dashed border thicker and cyan */
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    /* Slightly lighter background */
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--secondary);
    background: rgba(8, 217, 214, 0.1);
}

.upload-content {
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
}

.upload-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* Stats */
.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.8;
}

.score {
    font-size: 4rem;
    font-weight: 800;
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(8, 217, 214, 0.5);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-white {
    color: var(--light);
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

.leaderboard-item:hover {
    transform: scale(1.01);
    background: rgba(255, 255, 255, 0.08);
}

.rank-badge {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 3rem;
    height: 3rem;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark);
}

.item-thumb {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    background: #000;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-stats-row {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.pct-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 300px;
}

.pct-bar-fill {
    height: 100%;
    background: var(--secondary);
}

.item-roast {
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0.8;
    color: var(--light);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Sorting Controls */
.sort-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--light);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sort-btn.active {
    background: var(--secondary);
    color: var(--dark);
    border-color: var(--secondary);
}

@media (max-width: 600px) {
    .leaderboard-item {
        flex-direction: column;
        text-align: center;
    }

    .item-stats-row {
        justify-content: center;
    }

    .pct-bar-container {
        margin: 0.5rem auto;
    }
}

/* Image Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--secondary);
    text-decoration: none;
    cursor: pointer;
}

#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Roast Loading Animation */
.dot-typing {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient);
    animation: dotPulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.5;
    } 
    40% { 
        transform: scale(1.1);
        opacity: 1;
    }
}