/* ============================================
   CHROMASOFT ADMIN PANEL
   Design: Matching main website colors
   ============================================ */

:root {
    /* Colors from main website */
    --primary-color: #3B82F6;
    --secondary-color: #8B5CF6;
    --accent-color: #06b6d4;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);

    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-gray: #f8fafc;
    --color-border: #e5e7eb;

    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg-gray);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--primary-gradient);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-md);
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 1.75rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.login-header p {
    color: var(--color-text-light);
}

.login-footer {
    text-align: center;
    margin-top: var(--spacing-md);
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */

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

.admin-sidebar {
    width: 260px;
    background: var(--primary-gradient);
    color: white;
    padding: var(--spacing-lg);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.admin-sidebar .logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    justify-content: flex-start;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-nav ul {
    list-style: none;
}

.admin-nav li {
    margin-bottom: var(--spacing-xs);
}

.admin-nav a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.admin-nav a.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: var(--spacing-lg);
    width: calc(100% - 260px);
}

/* ============================================
   ADMIN HEADER
   ============================================ */

.admin-header {
    margin-bottom: var(--spacing-lg);
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-header p {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

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

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

.alert-warning {
    background: #fef3c7;
    border-color: var(--color-warning);
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-color: var(--color-info);
    color: #1e40af;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

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

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

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-group label small {
    display: block;
    font-weight: 400;
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-control,
.form-input,
.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: all 0.2s;
    background: white;
    color: var(--color-text);
}

.form-control:focus,
.form-input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
    font-family: var(--font-family);
}

/* ============================================
   TEXT SECTIONS (EDIT TEXTS PAGE)
   ============================================ */

.text-section {
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.section-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    user-select: none;
}

.section-header:hover {
    filter: brightness(1.05);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.section-content {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    display: none; /* Default closed */
}

.section-content.open {
    display: block;
}

.text-item {
    padding: var(--spacing-md);
    background: var(--color-bg-gray);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--color-border);
}

.text-item:last-child {
    margin-bottom: 0;
}

.text-item label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--color-text);
}

.text-item label strong {
    display: block;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-family: 'Courier New', monospace;
}

.text-item input[type="text"],
.text-item textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: var(--font-family);
    background: white;
    transition: all 0.2s;
}

.text-item textarea {
    min-height: 120px;
    line-height: 1.7;
    resize: vertical;
}

.text-item input[type="text"]:focus,
.text-item textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fafcff;
}

/* ============================================
   SEARCH
   ============================================ */

.search-container {
    margin-bottom: var(--spacing-lg);
}

.search-box {
    position: relative;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-left: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.form-actions {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--color-border);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-start;
}

/* ============================================
   STATS GRID (DASHBOARD)
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.stat-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.stat-card--success {
    border-left: 4px solid var(--color-success);
}

.stat-card--info {
    border-left: 4px solid var(--color-info);
}

.stat-card--warning {
    border-left: 4px solid var(--color-warning);
}

.stat-card--primary {
    border-left: 4px solid var(--primary-color);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* ============================================
   DASHBOARD SECTIONS
   ============================================ */

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.dashboard-section {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.dashboard-section h2 {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--color-bg-gray);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.system-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm);
    background: var(--color-bg-gray);
    border-radius: var(--border-radius);
}

.info-row .label {
    color: var(--color-text-light);
    font-weight: 500;
}

.info-row .value {
    color: var(--color-text);
    font-family: monospace;
}

/* ============================================
   MESSAGES
   ============================================ */

.messages-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.message-card {
    background: white;
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--color-border);
}

.message-card.unread {
    border-left-color: var(--primary-color);
    background: #fafcff;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.message-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.message-info strong {
    font-size: 1.1rem;
    color: var(--color-text);
}

.badge {
    padding: 0.4rem 0.875rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-bg-gray);
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

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

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

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

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

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

.message-date {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.message-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-bg-gray);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.message-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.message-meta a:hover {
    text-decoration: underline;
}

.message-content {
    margin-bottom: var(--spacing-md);
}

.message-content p {
    color: var(--color-text);
    line-height: 1.7;
    margin-top: 0.5rem;
}

.message-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   MOBILE MENU
   ============================================ */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 1001;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.625rem;
    cursor: pointer;
    box-shadow: var(--box-shadow-lg);
}

.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-backdrop.open {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
        padding-top: 4rem;
    }

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

    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .message-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }
}

/* ============================================
   ANALYTICS SECTIONS
   ============================================ */

.analytics-section {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.analytics-section h2 {
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-bg-gray);
}

.section-description {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
    margin-top: var(--spacing-sm);
}

.table-container {
    overflow-x: auto;
    margin-top: var(--spacing-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.data-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.data-table th {
    padding: var(--spacing-md) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.data-table th:first-child {
    border-top-left-radius: var(--border-radius);
}

.data-table th:last-child {
    border-top-right-radius: var(--border-radius);
}

.data-table td {
    padding: var(--spacing-md) var(--spacing-md);
    border-bottom: 1px solid #f1f5f9;
    background: white;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

.data-table tbody tr:hover td {
    background: #f0f7ff;
    transform: scale(1.001);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius);
}

.data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius);
}

.data-table code {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    border: 1px solid #bae6fd;
}

.data-table small {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

.data-table strong {
    color: var(--color-text);
    font-weight: 600;
}

.data-table .badge {
    display: inline-block;
    white-space: nowrap;
}
