/* Admin Dashboard Styles */
/* Extends the main site CSS with admin-specific styles */

/* Admin Mode Controls */
.admin-mode-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.admin-mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 6px;
    color: #28a745;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-mode-indicator i {
    font-size: 1rem;
}

#exit-admin-mode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#exit-admin-mode:hover {
    background: #5a6268;
}

/* Admin Mode Body Class */
body.admin-mode {
    --admin-mode-active: true;
}

body.customer-mode {
    --admin-mode-active: false;
}

:root {
    /* Admin color scheme - matching products page */
    --admin-primary: #FF6B4A;
    --admin-primary-dark: #E5533A;
    --admin-secondary: #1a1a1a;
    --admin-bg-light: #f8f9fa;
    --admin-bg-white: #ffffff;
    --admin-border: #e1e8ed;
    --admin-text: #333333;
    --admin-text-light: #6c757d;
    --admin-success: #28a745;
    --admin-warning: #ffc107;
    --admin-danger: #dc3545;
    --admin-info: #17a2b8;
    --admin-sidebar-bg: #1a1a1a;
    --admin-sidebar-hover: #2a2a2a;
}

/* Admin Login Page */
.admin-login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--admin-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

/* Admin Access States */
.admin-access-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.admin-access-box {
    background: var(--admin-bg-white);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.admin-access-header {
    margin-bottom: 30px;
}

.admin-access-header .success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--admin-success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    animation: successPulse 2s infinite;
}

.admin-access-header .error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--admin-danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.admin-access-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0 0 12px 0;
}

.admin-access-header p {
    font-size: 16px;
    color: var(--admin-text-light);
    margin: 0;
    line-height: 1.6;
}

.admin-access-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-access-actions .btn-primary,
.admin-access-actions .btn-secondary {
    width: 100%;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
}

.admin-access-actions .btn-primary {
    background: var(--admin-primary);
    color: white;
}

.admin-access-actions .btn-primary:hover {
    background: var(--admin-primary-dark);
    transform: translateY(-2px);
}

.admin-access-actions .btn-secondary {
    background: var(--admin-bg-light);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.admin-access-actions .btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.admin-login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.admin-login-box {
    background: var(--admin-bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px;
    position: relative;
}

.admin-login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.admin-login-logo img {
    height: 50px;
    margin-bottom: 16px;
}

.admin-login-logo h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--admin-secondary);
    margin: 0;
}

/* Form Styles */
.admin-login-form .form-group {
    margin-bottom: 24px;
}

.admin-login-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--admin-text-light);
    font-size: 16px;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--admin-bg-white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--admin-text-light);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--admin-text);
}

/* Checkbox Styles */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--admin-border);
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-label {
    font-size: 14px;
    color: var(--admin-text);
}

.forgot-password {
    font-size: 14px;
    color: var(--admin-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--admin-primary-dark);
    text-decoration: underline;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: var(--admin-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    background: var(--admin-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Error Message */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    color: var(--admin-danger);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.success-message {
    background: rgba(40, 167, 69, 0.1);
    color: var(--admin-success);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* Footer */
.admin-login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--admin-border);
}

.admin-login-footer p {
    font-size: 13px;
    color: var(--admin-text-light);
    margin: 0;
}

/* Background Shapes */
.admin-login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    background: var(--admin-primary);
}

.bg-shape-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -200px;
}

.bg-shape-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -150px;
}

.bg-shape-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .admin-login-box {
        padding: 32px 24px;
    }
    
    .admin-login-logo h2 {
        font-size: 20px;
    }
    
    .input-wrapper input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Admin Dashboard Layout */
.admin-dashboard {
    min-height: 100vh;
    background: var(--admin-bg-light);
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--admin-sidebar-bg);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar-logo img {
    height: 36px;
}

.admin-sidebar-logo h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Navigation Menu */
.admin-nav {
    padding: 24px 0;
}

.admin-nav-item {
    display: block;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.admin-nav-item:hover {
    background: var(--admin-sidebar-hover);
    color: white;
}

.admin-nav-item.active {
    background: var(--admin-primary);
    color: white;
}

.admin-nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

/* Main Content */
.admin-main {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.admin-header {
    background: white;
    padding: 20px 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-content {
    padding: 32px;
}

/* Responsive Sidebar */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--admin-text);
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .admin-header {
        padding: 16px 20px;
    }
    
    .admin-content {
        padding: 20px;
    }
}