/**
 * AlinaTana CMS - Admin Stylesheet
 */

/* CSS Variables */
:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-sidebar: #1E293B;
    --bg-sidebar-hover: #334155;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-sidebar: #E2E8F0;
    --text-muted: #94A3B8;
    --accent: #F49A2B;
    --accent-hover: #D98317;
    --accent-light: rgba(244, 154, 43, 0.1);
    --success: #22C55E;
    --success-light: rgba(34, 197, 94, 0.1);
    --warning: #EAB308;
    --warning-light: rgba(234, 179, 8, 0.1);
    --error: #EF4444;
    --error-light: rgba(239, 68, 68, 0.1);
    --border: #E2E8F0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --sidebar-width: 250px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

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

.sidebar-logo {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 10px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-sidebar);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}

.nav-link.active {
    background: var(--accent);
    color: #fff;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-sub {
    background: rgba(0, 0, 0, 0.1);
}

.nav-sub .nav-link {
    padding-left: 52px;
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 15px;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 8px;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-input {
    flex: 1;
    border-radius: 0;
}

.input-group .form-input:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .form-input:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
}

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

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

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

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-stats .stat-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-detail {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-align: center;
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.quick-action svg {
    width: 24px;
    height: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

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

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-success:hover {
    background: #16A34A;
    color: #fff;
}

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

.btn-danger:hover {
    background: #DC2626;
    color: #fff;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 5px;
}

/* Character Counter */
.char-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-left: 10px;
}

.char-counter.good {
    color: var(--success);
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.error {
    color: var(--error);
}

.char-counter::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-published {
    background: var(--success-light);
    color: var(--success);
}

.badge-draft {
    background: var(--warning-light);
    color: #A16207;
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-success {
    background: var(--success-light);
    color: #166534;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400E;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
}

.table tr:hover td {
    background: var(--bg-secondary);
}

.table-actions {
    display: flex;
    gap: 8px;
}

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

.alert-success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: #854D0E;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.alert-error {
    background: var(--error-light);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

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

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.2s;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--text-primary);
}

.login-logo span {
    color: var(--accent);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--text-primary);
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 15px;
    }

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

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.hidden { display: none !important; }
