/* Base Styles */
:root {
    --primary-color: #722F37;
    /* Merlot */
    --secondary-color: #F4E4D7;
    /* Champagne */
    --accent-color: #ff9999;
    /* Light reddish pink */
    --text-color: #333;
    --background-color: #fff;
    --white: #ffffff;
    --shadow: none;
    /* Removed shadow for clean paper look */
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: url('https://www.transparenttextures.com/patterns/cream-paper.png');
    /* Subtle texture */
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
    color: #444;
}

.container {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

/* Utilities */
.hidden {
    display: none !important;
}

.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

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

/* Section Headers (Script Font) */
.section-title {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: var(--accent-color);
    text-align: center;
    margin: 40px 0 20px;
    font-weight: normal;
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 24px;
    /* Reduced vertical padding */
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    width: 100%;
    margin-top: 15px;
    /* Reduced top margin */
    /* box-shadow: 0 4px 6px rgba(0,0,0,0.1); */
}

.btn-primary:hover {
    background-color: #ff7777;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid #ccc;
    color: #666;
    padding: 10px 20px;
    border-radius: 30px;
    width: 100%;
    margin-top: 20px;
}

.btn-link {
    background: none;
    color: var(--text-color);
    text-decoration: underline;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Login Section */
#login-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: #fff;
    padding: 10px;
    /* Reduced padding */
}

/* Container inside login section for better control */
#login-section .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    max-height: 100vh;
}

.hero-image {
    max-width: 120px;
    /* Slightly smaller */
    height: auto;
    margin-bottom: 10px;
    /* Reduced margin */
}

#login-section h1 {
    font-size: 2rem;
    /* Smaller "Welcome to" */
    margin-bottom: 5px;
    /* Reduced margin */
    color: #333;
    line-height: 1.2;
}

#login-section h1 span {
    font-family: 'Great Vibes', cursive;
    color: var(--accent-color);
    display: block;
    font-size: 3.5rem;
    /* Slightly smaller script text */
    margin-top: 5px;
    /* Reduced margin */
    font-weight: normal;
    line-height: 1.1;
}

#login-section p {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #666;
}

#username {
    padding: 12px;
    border: none;
    border-bottom: 2px solid #ddd;
    background: transparent;
    width: 100%;
    max-width: 300px;
    /* Limit width */
    font-size: 1.1rem;
    margin-top: 10px;
    text-align: center;
    outline: none;
}

#username:focus {
    border-color: var(--accent-color);
}

/* Wine List */
#wines-section header {
    padding: 20px;
    background-color: transparent;
    text-align: right;
    /* "guess the notes" style */
}

#wines-section header h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 3rem;
    color: var(--accent-color);
    transform: rotate(90deg);
    position: fixed;
    right: -60px;
    top: 150px;
    display: none;
    /* Hide on mobile mostly, show on desktop if wanted */
}

.user-info {
    font-size: 0.9rem;
    color: #999;
    text-align: center;
    margin-bottom: 20px;
}

.wine-card {
    background: transparent;
    margin-bottom: 40px;
    padding: 0 10px;
    text-align: center;
}

/* Wine Card Styles */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 5px;
}

.winery {
    font-size: 1rem;
    font-weight: bold;
    color: #555;
    text-transform: none;
    font-family: 'Playfair Display', serif;
}

.extra-info {
    font-style: normal;
    color: #888;
    font-size: 0.85rem;
    margin-top: 0;
    line-height: 1.2;
    margin-bottom: 5px;
}

.type-badge {
    display: none;
    /* Hide badges for cleaner look */
}

.wine-card h3 {
    margin-bottom: 5px;
    font-size: 1.6rem;
    color: #333;
    font-weight: normal;
}

.wine-card .year {
    font-weight: normal;
    font-size: 1.6rem;
    color: #333;
}


.wine-specs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #666;
    font-size: 0.95rem;
}

.spec {
    display: inline;
}

.spec .label {
    display: none;
}

.spec .value {
    font-weight: normal;
}

.grapes {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
}

.rated-badge {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.rate-btn {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    width: auto;
    margin: 0;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.rate-btn:hover {
    background: var(--accent-color);
    color: white;
}

.rate-btn.rated {
    background: var(--secondary-color);
    color: #555;
    border-color: #ddd;
}

.rate-btn.rated {
    color: var(--accent-color);
}

/* Separator */
.separator {
    text-align: center;
    color: var(--accent-color);
    font-size: 1.5rem;
    margin: 30px 0;
    letter-spacing: 5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Slides up from bottom on mobile */
    z-index: 1000;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 600px;
    padding: 30px 20px;
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

/* Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    margin: 20px 0;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating input:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
    color: var(--accent-color);
}

textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-bottom: 2px solid #ddd;
    background: #f9f9f9;
    border-radius: 0;
    font-family: inherit;
    resize: none;
    margin-bottom: 10px;
}

textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* Results */
.result-item {
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.result-user {
    font-weight: bold;
    color: #333;
}

.result-wine {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.result-rating {
    color: var(--accent-color);
}

.result-notes {
    font-style: italic;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.match {
    background-color: #d4edda;
    color: #155724;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.correct-notes {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #333;
    margin-top: 5px;
    border-left: 3px solid var(--accent-color);
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.tab {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab.active,
.tab:hover {
    background: var(--accent-color);
    color: white;
}

.tab-content.hidden {
    display: none;
}

/* Leaderboard */
#leaderboard {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid #eee;
}

#leaderboard h3 {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-weight: normal;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px dashed #eee;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank-1 {
    color: gold;
    font-weight: bold;
}

.rank-2 {
    color: silver;
    font-weight: bold;
}

.rank-3 {
    color: #cd7f32;
    font-weight: bold;
}

/* Wine Summary */
#wine-summary h3 {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: normal;
}

.summary-card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.summary-card h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 5px;
}

.avg-rating {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 5px;
}