/* ===================================
   Online Shop - Admin Panel Styles
   Dashboard Interface
   =================================== */

/* The Trendy Frick Brand Colors */
:root {
    --primary-color: #7DD8D3;
    --primary-dark: #5BC5BF;
    --primary-light: #A8E6E3;
    --secondary-color: #000000;
    --accent-color: #808080;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --dark: #1e293b;
    --dark-lighter: #334155;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Brand Typography - Matching Logo */
    --font-logo: 'Times New Roman', 'Georgia', 'Garamond', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--gray-lighter);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-logo);
    font-weight: 400;
    letter-spacing: 1px;
}

/* ===================================
   Login Page
   =================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 16px;
}

.login-title {
    font-family: var(--font-logo);
    text-align: center;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 32px;
}

/* ===================================
   Admin Layout
   =================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--dark);
    color: var(--white);
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
}

.admin-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--dark-lighter);
    margin-bottom: 24px;
    text-align: center;
}

.admin-logo img {
    width: 140px;
    height: auto;
    margin: 0 auto 12px;
    display: block;
}

.admin-logo-text {
    font-family: var(--font-logo);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--white);
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}

.admin-logo h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav {
    padding: 0 12px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius);
    color: var(--gray-light);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.admin-nav-link:hover {
    background-color: var(--dark-lighter);
    color: var(--white);
}

.admin-nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.admin-nav-icon {
    font-size: 1.25rem;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

/* Header */
.admin-header {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
}

.admin-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===================================
   Statistics Cards
   =================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.blue {
    background-color: rgba(37, 99, 235, 0.1);
}

.stat-card-icon.green {
    background-color: rgba(16, 185, 129, 0.1);
}

.stat-card-icon.orange {
    background-color: rgba(245, 158, 11, 0.1);
}

.stat-card-title {
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

/* ===================================
   Tables
   =================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-lighter);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

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

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

.table thead {
    background-color: var(--gray-lighter);
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-lighter);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--gray-lighter);
}

/* ===================================
   Badges
   =================================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fed7aa;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ===================================
   Buttons
   =================================== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background-color: var(--error-color);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===================================
   Forms
   =================================== */

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--error-color);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-text {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 4px;
}

/* ===================================
   Alerts
   =================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--error-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--secondary-color);
}

/* ===================================
   Mode Toggle (Manual/Scrape)
   =================================== */

.mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.mode-btn {
    flex: 1;
    padding: 12px 24px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.mode-btn.active {
    border-color: var(--primary-color);
    background-color: rgba(8, 145, 178, 0.1);
    color: var(--primary-color);
}

/* ===================================
   Image Preview
   =================================== */

.image-preview {
    margin-top: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 300px;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   Modal
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--gray-lighter);
    color: var(--dark);
}

/* ===================================
   Loading
   =================================== */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   Utilities
   =================================== */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
    .admin-sidebar {
        width: 70px;
    }

    .admin-sidebar .admin-logo h2 span:last-child,
    .admin-sidebar .admin-nav-link span:last-child {
        display: none;
    }

    .admin-main {
        margin-left: 70px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: scroll;
    }
}
