/* Admin Authentication Styles */

/* Hide Applications link by default (shown only when logged in) */
a[href="applications-list.html"] {
    display: none !important;
}

/* Auth Nav Link Styling */
.auth-nav-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* When logged in, change text to "Logout" */
.auth-nav-link.logged-in {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.auth-nav-link.logged-in:hover {
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* Admin Menu Dropdown */
#adminMenu {
    position: fixed;
    top: 70px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 10001;
    min-width: 200px;
    overflow: hidden;
}

#adminMenu button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: white;
    color: #333;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #eee;
}

#adminMenu button:hover {
    background: #f8f9fa;
}

#adminMenu button:last-child {
    border-bottom: none;
}

/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f3f5;
    color: #333;
}

/* Login Modal */
#loginModal .modal-content {
    max-width: 420px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    border-left: 4px solid #c33;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

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

/* User Management Modal */
#userManagementModal .modal-content {
    max-width: 1000px;
}

.user-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.users-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.users-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.role-badge.role-administrator {
    background: #e7f5ff;
    color: #1971c2;
}

.role-badge.role-user {
    background: #f3f0ff;
    color: #5f3dc4;
}

.btn-delete {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #ffe3e3;
    border-color: #ffa8a8;
}

.btn-add-user {
    background: #51cf66;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-user:hover {
    background: #40c057;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(81, 207, 102, 0.3);
}

/* Add User Modal */
#addUserModal .modal-content {
    max-width: 500px;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Notification Toast */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-size: 15px;
    font-weight: 600;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #51cf66;
    color: white;
}

.notification-error {
    background: #ff6b6b;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    #adminMenu {
        top: 70px;
        right: 10px;
    }

    .modal-content {
        padding: 20px;
        max-width: 95%;
    }

    #userManagementModal .modal-content {
        padding: 15px;
    }

    .users-table {
        font-size: 13px;
    }

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

    .modal-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #868e96;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 16px;
}
