/**
 * Metal Cabinet Maker - Admin Panel Styles
 * Modern, responsive admin dashboard design
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header .logo {
    margin-bottom: 1rem;
}

.login-header .logo i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: #f97316;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-form {
    padding: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group label i {
    margin-right: 0.5rem;
    color: #6b7280;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.btn-block {
    width: 100%;
}

.login-footer {
    padding: 1.5rem 2rem;
    background: #f9fafb;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.login-footer a {
    color: #f97316;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 0.5rem;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.admin-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.admin-content {
    flex: 1;
    margin-left: 280px;
    padding: 0.5rem 1rem 4rem;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-logo i {
    font-size: 2rem;
    margin-right: 0.75rem;
    color: #f97316;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #f97316;
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.nav-badge {
    background: #f97316;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
}

/* Content Header */
.content-header {
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-header p {
    color: #64748b;
    margin: 0;
}

.btn-outline-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background: #3b82f6;
    color: white;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.products { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.categories { background: linear-gradient(135deg, #10b981, #047857); }
.stat-icon.pages { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.views { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.stat-change.positive {
    background: #dcfce7;
    color: #16a34a;
}

.stat-change.negative {
    background: #fef2f2;
    color: #dc2626;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.dashboard-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.dashboard-card h3 i {
    margin-right: 0.5rem;
    color: #f97316;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    transition: all 0.3s ease;
}

.quick-action:hover {
    border-color: #f97316;
    color: #f97316;
    background: #fff7ed;
}

.quick-action i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.activity-icon.create { background: #10b981; }
.activity-icon.update { background: #f59e0b; }
.activity-icon.delete { background: #ef4444; }
.activity-icon.login { background: #3b82f6; }

.activity-content p {
    margin-bottom: 0.25rem;
    color: #374151;
}

.activity-content small {
    color: #6b7280;
}

/* Language Status */
.language-status {
    gap: 1rem;
}

.lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.lang-item:last-child {
    border-bottom: none;
}

.lang-info {
    display: flex;
    align-items: center;
}

.lang-flag {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.lang-name {
    font-weight: 500;
    color: #374151;
}

.lang-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #ea580c);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    min-width: 35px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 1rem 1rem 4rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 2rem;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ---- Generic Cards (used in forms) ---- */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

/* ---- Simple grid (Bootstrap-like) ---- */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.col-md-8 { flex: 0 0 calc(66.666% - 0.5rem); max-width: calc(66.666% - 0.5rem); }
.col-md-4 { flex: 0 0 calc(33.333% - 0.5rem); max-width: calc(33.333% - 0.5rem); }

@media (max-width: 992px) {
    .col-md-8, .col-md-4 { flex: 0 0 100%; max-width: 100%; }
}

/* ---- Tabs (Bootstrap-like look without dependency) ---- */
.nav { list-style: none; padding-left: 0; margin: 0; }
.nav-tabs { display: flex; border-bottom: 1px solid #e5e7eb; gap: 0.25rem; padding: 0 1.25rem; }
.nav-tabs .nav-item { margin-bottom: -1px; }
.nav-tabs .nav-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    color: #64748b;
    text-decoration: none;
}
.nav-tabs .nav-link:hover { color: #1f2937; }
.nav-tabs .nav-link.active {
    color: #1e293b;
    background-color: #ffffff;
    border-color: #e5e7eb #e5e7eb transparent;
}

.tab-content { padding: 1rem 1.25rem; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-pane.show { animation: fadeIn 0.15s ease-in; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ---- Form controls ---- */
.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
    color: #334155;
}
.form-control:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
select.form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea.form-control { resize: vertical; }

.form-text { display: block; margin-top: 0.25rem; color: #6b7280; font-size: 0.85rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1rem; height: 1rem; }
.form-check-label { color: #374151; }

/* ---- Buttons ---- */
.btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}
.btn-secondary:hover { background: #d1d5db; }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-muted { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

/* ---- Buttons - small variants and palette ---- */
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; border-radius: 6px; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-info { background: #3b82f6; color: #fff; }
.btn-info:hover { background: #2563eb; }

/* ---- Tables ---- */
.table-responsive { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.admin-table thead th { 
    text-align: left; font-weight: 600; color: #475569; font-size: 0.9rem;
    padding: 0.75rem 1rem; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
}
.admin-table tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tbody tr:hover { background: #f9fafb; }
.admin-table code { background: #f3f4f6; padding: 0.1rem 0.35rem; border-radius: 4px; }

.item-info small { display: block; color: #6b7280; margin-top: 0.25rem; }

/* ---- Status toggle ---- */
.status-toggle { 
    display:inline-flex; align-items:center; gap:.4rem; padding: .35rem .6rem; 
    border-radius: 999px; border: 1px solid transparent; cursor: pointer; 
    font-size: 0.8rem; background: #f3f4f6; color: #374151; 
}
.status-toggle.active { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.status-toggle.inactive { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.status-badge { padding: .25rem .5rem; border-radius: 999px; font-size: .75rem; }
.status-badge.active { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-badge.inactive { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---- Action buttons group ---- */
.action-buttons { display: flex; gap: .35rem; align-items: center; }

/* ---- Legacy class mapping to new look ---- */
/* Cards */
.filters-card,
.table-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
}
.filters-card .card-header,
.table-card .table-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.filters-card .card-body,
.table-card .card-body { padding: 1.25rem; }

/* Table header alignment */
.table-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.table-title h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #1e293b; }
.bulk-actions { display:flex; align-items:center; gap:.5rem; }

/* Filters */
.filters-form { display:flex; flex-wrap:wrap; gap: 1rem; align-items:flex-end; }
.filter-group { min-width: 220px; flex: 1; }
.filter-group label { display:block; margin-bottom: .4rem; font-weight: 500; color:#374151; }
.filter-actions { display:flex; align-items:center; gap:.5rem; }

/* Empty state */
.empty-state { text-align:center; padding: 2rem 1rem; color:#64748b; }
.empty-state i { font-size: 2rem; color:#94a3b8; margin-bottom:.5rem; }
.empty-state h3 { margin: .25rem 0 .5rem; color:#1e293b; }

/* Pagination wrapper */
.pagination-wrapper { margin-top: 1rem; display:flex; justify-content:center; }

/* Admin pagination - improved look */
.admin-pagination {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: saturate(120%) blur(6px);
    -webkit-backdrop-filter: saturate(120%) blur(6px);
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -6px 16px rgba(0,0,0,0.06);
    margin-top: 1rem;
    z-index: 900;
    display: flex;
    justify-content: center;
}

.admin-pagination .btn-group {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-pagination .btn-sm {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1;
}

.admin-pagination .btn-secondary {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.admin-pagination .btn-secondary:hover { 
    background: #f8fafc; 
    border-color: #e2e8f0; 
}

.admin-pagination .btn-secondary[aria-disabled="true"],
.admin-pagination .btn[aria-disabled="true"] {
    opacity: .6;
    cursor: default;
    box-shadow: none;
}

.admin-pagination .btn-primary {
    box-shadow: 0 8px 20px rgba(249,115,22,0.25);
}

@media (max-width: 768px) {
    .admin-pagination {
        padding: 0.5rem 0.75rem;
        overflow-x: auto;
    }
    .admin-pagination .btn-group {
        flex-wrap: nowrap;
    }
}

/* Form checkbox */
.form-checkbox { width: 18px; height: 18px; accent-color: #f97316; }

/* ---- Global base: make legacy pages look modern without HTML changes ---- */
.admin-content table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.admin-content thead th { text-align: left; font-weight: 600; color: #475569; font-size: 0.9rem; padding: 0.75rem 1rem; background: #f8fafc; border-bottom: 1px solid #e5e7eb; }
.admin-content tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-content tbody tr:hover { background: #f9fafb; }
.admin-content code { background: #f3f4f6; padding: 0.1rem 0.35rem; border-radius: 4px; }

.admin-content input[type="text"],
.admin-content input[type="number"],
.admin-content input[type="email"],
.admin-content input[type="password"],
.admin-content input[type="url"],
.admin-content input[type="search"],
.admin-content select,
.admin-content textarea { 
    width: 100%; padding: 0.625rem 0.75rem; border: 2px solid #e5e7eb; border-radius: 8px; 
    font-size: 0.95rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; background-color: #fff; color: #334155;
}
.admin-content input[type="text"]:focus,
.admin-content input[type="number"]:focus,
.admin-content input[type="email"]:focus,
.admin-content input[type="password"]:focus,
.admin-content input[type="url"]:focus,
.admin-content input[type="search"]:focus,
.admin-content select:focus,
.admin-content textarea:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }

.admin-content input[type="checkbox"] { width: 18px; height: 18px; accent-color: #f97316; }
