/* ============================================
   BACK TO HAWKINS - ADMIN PANEL STYLES
   ============================================ */

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

:root {
    --red: #ff0040;
    --red-dark: #cc0033;
    --red-glow: rgba(255, 0, 64, 0.5);
    --green: #00ff88;
    --yellow: #ffcc00;
    --blue: #00d4ff;
    --bg: #0a0a0a;
    --bg-card: #111;
    --bg-surface: #1a1a1a;
    --border: rgba(255,255,255,0.08);
    --border-red: rgba(255,0,64,0.2);
    --text: #fff;
    --text-sec: #aaa;
    --text-muted: #666;
    --font: 'Segoe UI', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

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

/* ---- LOGIN PAGE ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background:
        radial-gradient(ellipse at center, rgba(255,0,64,0.08) 0%, transparent 60%),
        var(--bg);
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-red);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 0 40px rgba(255,0,64,0.1);
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--red);
    letter-spacing: 4px;
    text-shadow: 0 0 20px var(--red-glow);
    margin-bottom: 0.3rem;
}

.login-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

.login-form .form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.login-form label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-sec);
    margin-bottom: 0.4rem;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,0,64,0.04);
    border: 1px solid var(--border-red);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.login-form input:focus {
    border-color: var(--red);
    box-shadow: 0 0 15px rgba(255,0,64,0.15);
}

.login-error {
    background: rgba(255,60,60,0.1);
    border: 1px solid rgba(255,60,60,0.3);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    color: #ff6666;
    font-size: 0.85rem;
    display: none;
}

.login-error.visible { display: block; }

/* ---- SHARED BUTTON ---- */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font);
}

.btn-red {
    background: var(--red);
    color: #fff;
    box-shadow: 0 0 15px rgba(255,0,64,0.3);
    width: 100%;
}

.btn-red:hover { background: var(--red-dark); box-shadow: 0 0 25px rgba(255,0,64,0.5); }
.btn-red:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; letter-spacing: 1px; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-red);
    color: var(--text-sec);
}
.btn-outline:hover { border-color: var(--red); color: var(--red); }

.btn-green { background: rgba(0,255,136,0.15); color: var(--green); border: 1px solid rgba(0,255,136,0.3); }
.btn-green:hover { background: rgba(0,255,136,0.25); }

.btn-danger { background: rgba(255,60,60,0.15); color: #ff6666; border: 1px solid rgba(255,60,60,0.3); }
.btn-danger:hover { background: rgba(255,60,60,0.25); }

/* ---- ADMIN LAYOUT ---- */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-red);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.admin-brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--red);
    letter-spacing: 3px;
}

.admin-brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

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

.admin-nav a {
    color: var(--text-sec);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

.admin-nav a:hover, .admin-nav a.active {
    color: var(--red);
    background: rgba(255,0,64,0.08);
}

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

.admin-user-name {
    font-size: 0.85rem;
    color: var(--text-sec);
}

.admin-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ---- STATS BAR ---- */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.stat-card:hover, .stat-card.active {
    border-color: var(--red);
    box-shadow: 0 0 15px rgba(255,0,64,0.15);
}

.stat-card.active { background: rgba(255,0,64,0.05); }

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--red);
    line-height: 1;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.4rem;
}

/* ---- TOOLBAR ---- */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--red);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
}

/* ---- CANDIDATE GRID ---- */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.candidate-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.candidate-card:hover {
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.card-photo {
    width: 100%;
    height: 200px;
    background: var(--bg-surface);
    overflow: hidden;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1rem;
}

.card-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.card-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.action-btn.approve:hover {
    background: rgba(0,255,136,0.15);
    border-color: var(--green);
}

.action-btn.reject:hover {
    background: rgba(255,60,60,0.15);
    border-color: #ff4444;
}

.action-btn.delete:hover {
    background: rgba(255,60,60,0.15);
    border-color: #ff4444;
}

/* Status badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.badge-nuovo { background: rgba(0,212,255,0.15); color: var(--blue); border: 1px solid rgba(0,212,255,0.3); }
.badge-selezionato { background: rgba(0,255,136,0.15); color: var(--green); border: 1px solid rgba(0,255,136,0.3); }
.badge-scartato { background: rgba(255,60,60,0.1); color: #ff6666; border: 1px solid rgba(255,60,60,0.2); }
.badge-convocato { background: rgba(255,204,0,0.15); color: var(--yellow); border: 1px solid rgba(255,204,0,0.3); }

/* ---- CANDIDATE DETAIL PAGE ---- */
.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.detail-back:hover { color: var(--red); }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.detail-section h3 {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.detail-label { color: var(--text-muted); font-size: 0.85rem; }
.detail-value { color: var(--text); font-size: 0.9rem; }

.detail-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-photo {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.detail-photo:hover { transform: scale(1.02); }

.detail-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-text {
    color: var(--text-sec);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-video-link {
    display: inline-block;
    color: var(--blue);
    text-decoration: none;
    word-break: break-all;
}

.detail-video-link:hover { text-decoration: underline; }

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ---- CONVOCATION MODAL ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.visible { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-red);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    color: var(--red);
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.modal .form-group {
    margin-bottom: 1rem;
}

.modal label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-sec);
    margin-bottom: 0.3rem;
}

.modal input, .modal textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,0,64,0.04);
    border: 1px solid var(--border-red);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
}

.modal input:focus, .modal textarea:focus {
    border-color: var(--red);
}

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

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

/* ---- LIGHTBOX ---- */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox.visible { display: flex; }

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-text { font-size: 1rem; }

/* ---- LOADING ---- */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .admin-header { padding: 0.8rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .admin-content { padding: 1rem; }
    .stats-bar { gap: 0.5rem; }
    .stat-card { min-width: 80px; padding: 0.8rem; }
    .stat-number { font-size: 1.5rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .candidates-grid { grid-template-columns: 1fr; }
    .admin-nav { display: none; }
}

/* ---- PAGINATION ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 1rem;
    padding: 0.5rem 0;
}

.pagination .pag-info {
    font-size: 0.78rem;
    color: var(--text-sec);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pagination .pag-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- VOTE BUTTON "INTERESSANTE?" ---- */
.action-btn.vote {
    color: #c8a000;
    font-size: 1rem;
    transition: color 0.2s, transform 0.15s;
}
.action-btn.vote:hover { color: #ffd700; transform: scale(1.2); }
.action-btn.vote.voted { color: #ffd700; }

.vote-count {
    font-size: 0.62rem;
    font-weight: 700;
    color: #ffd700;
    vertical-align: super;
    margin-left: 1px;
    min-width: 10px;
    display: inline;
}

/* ---- PREFERITI TABLE ---- */
.preferiti-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.preferiti-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-sec);
    border-bottom: 1px solid var(--border);
}
.preferiti-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.preferiti-table tr:hover td { background: rgba(255,0,64,0.04); cursor: pointer; }
.preferiti-table .col-rank { color: var(--text-sec); font-size: 0.75rem; width: 36px; }
.preferiti-table .col-votes {
    font-weight: 700;
    color: #ffd700;
    font-size: 0.95rem;
    white-space: nowrap;
}
.preferiti-table .col-votes-zero { color: #444; }
.preferiti-table .col-ruolo {
    font-size: 0.75rem;
    color: #ff6680;
    max-width: 200px;
}
.preferiti-table .col-stato .badge { font-size: 0.65rem; }

/* ---- AUDITION MANAGER BADGE ---- */
.audition-manager-badge {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,0,64,0.1);
    padding: 8px;
    text-align: center;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.audition-manager-badge .am-powered {
    font-size: 0.6rem;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.audition-manager-badge .am-brand {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255,0,64,0.4);
    text-transform: uppercase;
}

/* ---- CONVOCATION MODE BUTTONS ---- */
.conv-mode-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    background: transparent;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font);
    letter-spacing: 0.5px;
}
.conv-mode-btn:hover {
    border-color: rgba(255,0,64,0.4);
    color: #ccc;
}
.conv-mode-btn.active {
    background: rgba(255,0,64,0.15);
    border-color: var(--red);
    color: #fff;
    font-weight: 600;
}

/* ---- CANDIDATE CHECKBOX LIST ---- */
.conv-candidate-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
    color: #ccc;
}
.conv-candidate-item:hover {
    background: rgba(255,0,64,0.08);
}
.conv-candidate-item input[type="checkbox"] {
    accent-color: var(--red);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.conv-candidate-item .conv-cand-name {
    flex: 1;
    font-weight: 500;
}
.conv-candidate-item .conv-cand-email {
    font-size: 0.75rem;
    color: #666;
}
.conv-candidate-item .conv-cand-status {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.conv-cand-status.selezionato { background: rgba(0,212,255,0.15); color: #00d4ff; }
.conv-cand-status.convocato { background: rgba(255,204,0,0.15); color: #ffcc00; }

/* ---- NEWSLETTER ADMIN ---- */
.newsletter-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 16px;
    background:
        radial-gradient(circle at 12% 20%, rgba(0,212,255,0.16), transparent 34%),
        radial-gradient(circle at 88% 10%, rgba(255,0,180,0.14), transparent 28%),
        var(--bg-card);
}

.newsletter-kicker {
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.newsletter-hero h1 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.95;
    letter-spacing: -1px;
    margin-bottom: 0.7rem;
}

.newsletter-hero p {
    max-width: 680px;
    color: var(--text-sec);
}

.admin-select {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,0,64,0.35);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-weight: 700;
}

.admin-message {
    display: none;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.admin-message.visible { display: block; }
.admin-message.success {
    color: var(--green);
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.22);
}
.admin-message.error {
    color: #ff7777;
    background: rgba(255,60,60,0.08);
    border: 1px solid rgba(255,60,60,0.22);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    padding: 0.8rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-sec);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: rgba(255,0,64,0.04); }

.newsletter-meta {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.newsletter-error {
    max-width: 340px;
    color: var(--text-muted);
    font-size: 0.78rem;
    word-break: break-word;
}

.newsletter-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 260px;
}

@media (max-width: 768px) {
    .newsletter-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.2rem;
    }

    .newsletter-hero h1 {
        font-size: 2rem;
        letter-spacing: 0;
    }

    .newsletter-actions {
        min-width: 220px;
    }
}
