/* ===========================================
   MAIN STYLESHEET - ADMIN PANEL V2
   Styles chính cho hệ thống quản trị
   =========================================== */

/* ===========================================
   IMPORT SHARED STYLES
   =========================================== */
@import url('./shared/variables.css');
@import url('./shared/base.css');

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

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-all);
    z-index: var(--z-fixed);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.theme-toggle i {
    font-size: 20px;
    transition: var(--transition-all);
}

/* Theme icon visibility - removed conflicting rules */

/* ===========================================
   LOGOUT MODAL STYLES
   =========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 24px;
}

.modal-icon.warning {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
}

.modal-body p {
    margin: 0 0 var(--space-sm);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.modal-subtitle {
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
}

.modal-footer {
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.modal-footer .btn {
    min-width: 120px;
    padding: var(--space-sm) var(--space-lg);
    font-weight: 500;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ee5a24, #c44569);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Responsive modal */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        margin: var(--space-md);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Theme icon rules moved to dashboard.css to avoid conflicts */

/* FontAwesome Duotone Icons */
.fa-duotone {
    --fa-primary-color: var(--primary-color);
    --fa-secondary-color: var(--primary-light);
    --fa-secondary-opacity: 0.4;
}

.theme-toggle .fa-duotone {
    --fa-primary-color: var(--text-primary);
    --fa-secondary-color: var(--text-secondary);
    --fa-secondary-opacity: 0.5;
}

.theme-toggle:hover .fa-duotone {
    --fa-primary-color: var(--primary-color);
    --fa-secondary-color: var(--primary-light);
    --fa-secondary-opacity: 0.7;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    text-align: center;
    padding: var(--space-8);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    min-width: 280px;
}

.loading-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform-origin: center;
    will-change: transform;
}

.loading-text {
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    letter-spacing: 0.025em;
}

/* Toast Container - Removed duplicate definition, handled in toast.css */

/* Responsive adjustments */
@media (max-width: 768px) {
    body.login-page #toast-container.toast-container,
    body.dashboard-page #toast-container.toast-container,
    .admin-panel #toast-container.toast-container {
        top: var(--space-4) !important;
        right: var(--space-4) !important;
        left: var(--space-4) !important;
        max-width: none !important;
    }
    
    .theme-toggle {
        bottom: var(--space-4);
        right: var(--space-4);
        width: 45px;
        height: 45px;
    }
}

/* Keyframes */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   COMPONENT IMPORTS
   =========================================== */
@import url('./components/toast.css');
@import url('./components/loading.css');
