/* Putin Loyalty Rating - Main Stylesheet */

/* CSS Variables */
:root {
    --color-primary: #1a365d;
    --color-primary-light: #2c5282;
    --color-accent: #c53030;
    --color-accent-light: #e53e3e;
    --color-success: #276749;
    --color-warning: #c05621;
    --color-bg: #f7fafc;
    --color-card: #ffffff;
    --color-text: #1a202c;
    --color-text-muted: #718096;
    --color-border: #e2e8f0;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 8px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-light);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--color-primary);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: white;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav a {
    color: rgba(255,255,255,0.9);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav .btn {
    color: white;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.page-title p {
    color: var(--color-text-muted);
}

/* Sorting Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.sort-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sort-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.sort-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    min-width: 200px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

/* Musicians List */
.musicians-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.musician-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.musician-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.rank-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 3rem;
    text-align: center;
}

.musician-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-border);
    flex-shrink: 0;
}

.musician-photo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-border), #cbd5e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.musician-info {
    flex: 1;
    min-width: 0;
}

.musician-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.musician-name-en {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.loyalty-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    min-width: 80px;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

/* Score colors */
.score-high { color: var(--color-accent); }
.score-medium { color: var(--color-warning); }
.score-low { color: var(--color-success); }

.score-bar {
    width: 100%;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

.score-bar-fill.high { background: var(--color-accent); }
.score-bar-fill.medium { background: var(--color-warning); }
.score-bar-fill.low { background: var(--color-success); }

.vote-btn {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.vote-btn:hover {
    background: var(--color-primary-light);
}

.vote-btn:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #cbd5e0;
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.auth-form {
    margin-bottom: 1rem;
}

.auth-switch {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.back-link {
    display: block;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert-warning {
    background: #feebc8;
    color: #c05621;
    border: 1px solid #fbd38d;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--color-border);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* Vote Modal Specific */
.vote-musician-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.vote-score-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vote-score-input input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: var(--color-border);
    border-radius: 4px;
    outline: none;
}

.vote-score-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.vote-score-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 60px;
    text-align: center;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Admin Badge */
.admin-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--color-accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
}

.status-pending {
    background: #feebc8;
    color: #c05621;
}

.status-approved {
    background: #c6f6d5;
    color: #276749;
}

.status-rejected {
    background: #fed7d7;
    color: #c53030;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-buttons {
        justify-content: center;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
        min-width: 0;
    }

    .musician-card {
        flex-wrap: wrap;
    }

    .rank-number {
        font-size: 1.5rem;
        min-width: 2.5rem;
    }

    .musician-photo,
    .musician-photo-placeholder {
        width: 50px;
        height: 50px;
    }

    .musician-info {
        order: 3;
        width: 100%;
        flex: none;
    }

    .loyalty-score {
        margin-left: auto;
    }

    .vote-btn {
        order: 4;
        width: 100%;
        margin-top: 0.5rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .musician-card {
        padding: 0.75rem;
    }

    .rank-number {
        font-size: 1.25rem;
    }

    .score-value {
        font-size: 1.5rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

/* Admin Specific */
.admin-container {
    padding: 2rem 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.admin-table {
    width: 100%;
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--color-bg);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Tab Navigation */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.5rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination .active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.pagination .disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}
