/* Base styles and theme */
:root {
    --color-coral: #FF6B6B;
    --color-teal: #4ECDC4;
    --color-yellow: #FFE66D;
    --color-purple: #A8DADC;
    --color-dark: #2C3E50;
    --color-light: #F7F7F7;
    --color-white: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-teal) 100%);
    min-height: 100vh;
    color: var(--color-dark);
    line-height: 1.6;
}

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

/* Landing Page */
.landing-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.welcome-card {
    background: var(--color-white);
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.app-title {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--color-coral);
}

.tagline {
    font-size: 1.5rem;
    color: var(--color-teal);
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.auth-options {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-options .btn {
    width: 100%;
}

.auth-card {
    max-width: 450px;
}

.auth-form {
    margin-top: 30px;
}

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

.name-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--color-purple);
    border-radius: 10px;
    transition: border-color 0.3s;
}

.name-input:focus {
    outline: none;
    border-color: var(--color-teal);
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

.auth-switch p {
    margin-bottom: 10px;
}

.auth-switch a {
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.admin-link-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.admin-link-section a {
    color: #999;
    font-size: 0.9rem;
    font-weight: normal;
}

.auth-card .back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--color-teal);
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--color-coral);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--color-purple);
    color: var(--color-dark);
}

.btn-secondary:hover {
    background: #96c9cc;
}

/* Gallery Page */
.gallery-page {
    padding: 20px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    color: var(--color-white);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.user-greeting {
    font-size: 1.2rem;
    opacity: 0.9;
}

.user-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.logout-link {
    display: inline-block;
    color: var(--color-white);
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.list-card {
    background: var(--color-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.list-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.list-thumbnail {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--color-light);
}

.list-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-yellow) 0%, var(--color-coral) 100%);
}

.placeholder-icon {
    font-size: 4rem;
}

.list-info {
    padding: 20px;
}

.list-title {
    font-size: 1.5rem;
    color: var(--color-coral);
    margin-bottom: 10px;
}

.list-description {
    color: #666;
    line-height: 1.5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-white);
    border-radius: 15px;
    color: #999;
    font-size: 1.2rem;
}

/* Back Link */
.back-link {
    display: inline-block;
    color: var(--color-white);
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 20px;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 0.8;
}

/* Summary Page */
.summary-page {
    padding: 20px 0;
}

.subtitle {
    margin: 0;
}

.results-section,
.matches-section {
    background: var(--color-white);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.results-section h2,
.matches-section h2 {
    color: var(--color-coral);
    margin-bottom: 25px;
    font-size: 2rem;
}

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

.swipe-result-card {
    background: var(--color-light);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.result-thumbnail {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #e0e0e0;
}

.result-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.result-info h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--color-dark);
}

.result-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-good {
    background: #4CAF50;
    color: white;
}

.badge-bad {
    background: #F44336;
    color: white;
}

/* Matches Leaderboard */
.matches-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--color-light);
    border-radius: 10px;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.match-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.match-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--color-dark);
}

.match-silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
}

.match-bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
}

.match-rank {
    font-size: 2rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.match-info {
    flex: 1;
}

.match-name {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.match-details {
    color: #666;
    font-size: 0.95rem;
}

.match-percentage {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--color-coral);
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

.percentage-value {
    display: inline-block;
    white-space: nowrap;
}

.match-gold .match-percentage,
.match-silver .match-percentage,
.match-bronze .match-percentage {
    color: var(--color-dark);
}

/* Preview Actions */
.preview-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 18px 35px;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-large .btn-icon {
    font-size: 1.5rem;
}

/* Compare Page */
.compare-page {
    padding: 20px 0;
}

.comparison-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    color: var(--color-dark);
    border: 2px solid var(--color-teal);
}

.comparison-section {
    background: var(--color-white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.comparison-section h2 {
    color: var(--color-coral);
    margin-bottom: 25px;
    font-size: 2rem;
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
}

.comparison-table thead {
    background: var(--color-light);
}

.comparison-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--color-dark);
    border-bottom: 2px solid #ddd;
}

.comparison-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.comparison-table tbody tr {
    transition: background-color 0.3s;
}

.comparison-table tbody tr:hover {
    background: var(--color-light);
}

.row-matched {
    background: rgba(76, 175, 80, 0.05);
}

.row-disagreed {
    background: rgba(244, 67, 54, 0.05);
}

.item-cell {
    width: 50%;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: var(--color-light);
}

.item-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-teal) 100%);
}

.item-text {
    flex: 1;
}

.item-text strong {
    display: block;
    margin-bottom: 5px;
    color: var(--color-dark);
    font-size: 1.05rem;
}

.item-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.response-cell {
    text-align: center;
    width: 15%;
}

.match-cell {
    text-align: center;
    width: 10%;
}

.match-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.match-yes {
    color: #4CAF50;
}

.match-no {
    color: #F44336;
}

/* Responsive */
@media (max-width: 768px) {
    .app-title {
        font-size: 2rem;
    }

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

    .swipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .comparison-stats {
        gap: 15px;
    }

    .stat-item {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .comparison-table {
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px;
    }

    .item-thumb {
        width: 40px;
        height: 40px;
    }

    .item-info {
        gap: 10px;
    }

    .item-text strong {
        font-size: 0.95rem;
    }

    .item-desc {
        font-size: 0.8rem;
    }

    .response-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
}
