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

/* Admin Overlay */
.admin-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.admin-overlay.active {
    display: flex;
}

/* Login Container */
.admin-login-container {
    position: relative;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 450px;
    animation: slideUp 0.5s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.login-close-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    transform: rotate(90deg);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366F1 0%, #F59E0B 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-field label i {
    color: #F59E0B;
}

.form-field input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-field input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-left: 3rem;
}

.toggle-password {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-password:hover {
    color: #F59E0B;
}

.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6366F1 0%, #F59E0B 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

.form-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10B981;
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #EF4444;
}

/* ==================== ADMIN DASHBOARD ==================== */
.admin-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A0721 0%, #0F0B2E 100%);
    z-index: 9999;
    display: none;
}

.admin-dashboard.active {
    display: flex;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    background: rgba(15, 11, 46, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.admin-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 2rem 2rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 2rem;
}

.admin-logo i {
    font-size: 2rem;
    color: #F59E0B;
}

.admin-logo span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.admin-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.admin-nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #fff;
    transform: translateX(-5px);
}

.admin-nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #fff;
    border-right: 3px solid #F59E0B;
}

.admin-nav-item i {
    font-size: 1.3rem;
}

.admin-logout-btn {
    margin: 2rem 1rem 0;
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #EF4444;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.admin-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
}

/* Main Content */
.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.admin-welcome h1 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.admin-welcome h1 span {
    color: #F59E0B;
}

.admin-welcome p {
    color: rgba(255, 255, 255, 0.6);
}

.admin-close-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.admin-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #EF4444;
}

/* Sections */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(99, 102, 241, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #6366F1 0%, #F59E0B 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.stat-details h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.stat-details p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* News Management */
.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-toolbar h2 {
    font-size: 1.8rem;
    color: #fff;
}

.btn-add {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6366F1 0%, #F59E0B 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* News Table */
.news-table-container {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

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

.news-table thead {
    background: rgba(99, 102, 241, 0.1);
}

.news-table th {
    padding: 1.25rem 1rem;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.news-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

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

.news-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table-thumb {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

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

.action-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.edit {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.action-btn.edit:hover {
    background: rgba(59, 130, 246, 0.2);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* News Form Modal */
.news-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
}

.news-form-modal.active {
    display: flex;
}

.news-form-container {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: rgba(15, 11, 46, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    overflow: hidden;
    animation: modalZoomIn 0.3s ease-out;
}

.news-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.news-form-header h2 {
    font-size: 1.5rem;
    color: #fff;
}

.modal-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    transform: rotate(90deg);
}

.news-form {
    padding: 2rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group textarea {
    min-height: 150px;
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #6366F1;
}

/* Fix dropdown option visibility */
.form-group select option {
    background: #1a1a2e;
    color: #fff;
    padding: 0.5rem;
}

.form-group select option:hover,
.form-group select option:checked {
    background: #6366F1;
    color: #fff;
}

.checkbox-group {
    display: flex;
    gap: 2rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
/* AI Thinking State for Buttons */
.btn-thinking {
    background: linear-gradient(135deg, #10B981 0%, #6366F1 100%) !important;
    position: relative;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.9;
}

.btn-thinking::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: brainShine 1.5s infinite;
}

@keyframes brainShine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.ai-pulse {
    animation: aiPulse 2s infinite ease-in-out;
}

@keyframes aiPulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }

    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

@media (max-width: 1024px) {
    .admin-dashboard {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 1rem;
        border-left: none;
        border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    }

    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .admin-logo {
        border-bottom: none;
        border-left: 1px solid rgba(99, 102, 241, 0.1);
        padding: 0 1rem;
        margin: 0 1rem 0 0;
    }

    .admin-logout-btn {
        margin: 0 0 0 1rem;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-toolbar .btn-add {
        width: 100%;
    }

    .news-table-container {
        overflow-x: auto;
    }
}