/* ========================================
   ADMIN PANEL STYLES
   ======================================== */

/* === LOGIN PAGE === */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 20px;
    padding: 50px 40px;
    backdrop-filter: blur(15px);
    box-shadow: 
        0 8px 32px rgba(0, 255, 247, 0.3),
        0 0 60px rgba(0, 255, 247, 0.1);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 247, 0.1) 0%, transparent 70%);
    animation: loginGlow 8s ease-in-out infinite;
}

@keyframes loginGlow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary-cyan);
    margin-bottom: 20px;
    box-shadow: 0 0 30px var(--primary-cyan);
    object-fit: cover;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(0, 255, 247, 0.1);
    border: 1px solid var(--primary-cyan);
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--primary-cyan);
}

.lock-icon {
    font-size: 1rem;
}

.login-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 30px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-cyan);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 15px;
    background: rgba(10, 10, 20, 0.6);
    border: 2px solid rgba(0, 255, 247, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 247, 0.3);
}

.input-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-cyan);
    transition: width 0.3s ease;
}

.form-group input:focus ~ .input-underline {
    width: 100%;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.error-message {
    color: var(--accent-red);
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid var(--accent-red);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    border: none;
    border-radius: 10px;
    color: var(--bg-dark);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 247, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover .btn-glow {
    left: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-cyan);
}

/* === ADMIN DASHBOARD === */
.admin-page {
    background-color: var(--bg-darker);
}

.admin-nav {
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary-cyan);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-cyan);
    object-fit: cover;
}

.nav-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-cyan);
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-cyan);
    background: rgba(0, 255, 247, 0.1);
}

.btn-logout {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.admin-header {
    text-align: center;
    margin-bottom: 50px;
}

.admin-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.admin-section {
    margin-top: 28px;
}

.section-heading {
    margin: 0 0 12px;
    color: var(--primary-cyan);
    letter-spacing: 1px;
}

.capacity-box {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 15px;
    padding: 20px;
}

.capacity-box label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.capacity-actions {
    display: flex;
    gap: 10px;
}

.capacity-actions input {
    width: 140px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 247, 0.3);
    background: rgba(10, 10, 20, 0.6);
    color: var(--text-primary);
}

.inline-form {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 15px;
    padding: 16px;
    display: grid;
    grid-template-columns: 130px repeat(3, 1fr) 170px;
    gap: 10px;
}

.inline-form input,
.inline-form select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 247, 0.3);
    background: rgba(10, 10, 20, 0.6);
    color: var(--text-primary);
}

/* === TABLE === */
.orari-table-container {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 255, 247, 0.2);
}

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

.orari-table thead {
    background: rgba(0, 255, 247, 0.1);
}

.orari-table th {
    padding: 20px;
    text-align: left;
    color: var(--primary-cyan);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--primary-cyan);
}

.orari-table td {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 255, 247, 0.1);
    color: var(--text-primary);
}

.orari-table tbody tr {
    transition: all 0.3s ease;
}

.orari-table tbody tr:hover {
    background: rgba(0, 255, 247, 0.05);
}

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

.loading-cell {
    text-align: center;
    padding: 60px !important;
}

.day-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(0, 255, 247, 0.1);
    border: 1px solid var(--primary-cyan);
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-cyan);
}

.time-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.time-value.closed-time {
    color: var(--accent-red);
}

.note-text {
    color: var(--text-secondary);
    font-style: italic;
}

.timestamp {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === ACTION BUTTONS === */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-edit, .btn-delete {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-edit {
    background: rgba(0, 255, 247, 0.1);
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
}

.btn-edit:hover {
    background: var(--primary-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--primary-cyan);
}

.btn-edit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-delete {
    background: rgba(255, 0, 85, 0.1);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.btn-delete:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 15px var(--accent-red);
}

.btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 255, 247, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 30px;
    border-bottom: 2px solid rgba(0, 255, 247, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-cyan);
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--accent-red);
    transform: rotate(90deg);
}

.modal-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: var(--bg-dark);
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(0, 255, 247, 0.5);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-secondary);
}

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

/* === ALERT === */
.alert-message {
    position: fixed;
    top: 100px;
    right: 30px;
    max-width: 400px;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: none;
    animation: slideInRight 0.3s ease;
}

.alert-message.show {
    display: block;
}

.alert-message.success {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.alert-message.error {
    background: rgba(255, 0, 85, 0.1);
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .orari-table {
        font-size: 0.9rem;
    }
    
    .orari-table th,
    .orari-table td {
        padding: 15px 10px;
    }
}

@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .capacity-actions {
        flex-direction: column;
    }

    .capacity-actions input {
        width: 100%;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }
    
    .orari-table-container {
        overflow-x: auto;
    }
    
    .orari-table {
        min-width: 800px;
    }
    
    .alert-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
