/* Atelsan Tarım - Premium Admin Dashboard Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
    --primary: #1e3a8a;       /* Deep elegant blue */
    --primary-light: #2563eb; /* Bright accent blue */
    --secondary: #0284c7;     /* Ocean teal */
    --accent: #10b981;        /* Success green */
    --accent-light: #34d399;  /* Soft green */
    --dark: #0f172a;          /* Slate 900 */
    --dark-card: #1e293b;     /* Slate 800 */
    --bg-light: #f8fafc;      /* Slate 50 */
    --text-muted: #64748b;    /* Slate 500 */
    --border-color: #e2e8f0;  /* Slate 200 */
    --sidebar-width: 260px;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-premium: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    overflow-x: hidden;
}

/* Login Screen Glassmorphic Overhaul */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, #1e3a8a 0%, #0f172a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 3rem;
    width: 440px;
    max-width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: white;
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    height: 50px;
    border-radius: 10px;
    padding-left: 1rem;
    transition: all 0.3s;
}

.login-card .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
    color: white;
}

.login-card label {
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar {
    height: 100vh;
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    background: #0b1329; /* Deep space dark blue */
    color: white;
    padding-top: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h3 {
    color: white;
    font-size: 1.35rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(to right, #ffffff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.65) !important;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    border-radius: 10px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 0.35rem;
    border-left: none;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: white !important;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

.nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

/* Header & Status Indicator */
.connection-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: inherit;
    border-radius: 50%;
    animation: statusPulse 1.8s infinite ease-in-out;
}

@keyframes statusPulse {
    0%    /*transform: scale(1.1);*/ opacity: 0.8; }
    100%    /*transform: scale(1.05);*/ opacity: 0; }
}

/* Dashboard Metric Cards */
.metric-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    box-shadow: var(--shadow-premium);
    border-color: rgba(37, 99, 235, 0.2);
}

.metric-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.metric-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}
.metric-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.metric-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.metric-yellow {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.metric-number {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Premium Styling for Cards */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-premium);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

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

.card-body {
    padding: 1.5rem;
}

/* Table Enhancements */
.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem 1.25rem;
    color: var(--dark);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

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

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Modern Form Fields */
.form-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: var(--dark);
    background-color: white;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

/* Premium Buttons */
.btn {
    border-radius: 8px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.15);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.3);
}

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

.btn-success:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
    color: white;
}

/* Tag Inputs */
.tags-input-container {
    min-height: 48px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.4rem 0.6rem !important;
}

.tags-input-container:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--dark);
}

.modal-body {
    padding: 2rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

/* Rich Preview Panels */
.preview-box {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    background-color: var(--bg-light);
    text-align: center;
    position: relative;
}

.preview-box img {
    max-height: 120px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    border: 3px solid white;
}

/* Sidebar Overlay Styling */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Overrides */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .metric-card {
        padding: 1.25rem;
    }

    .metric-number {
        font-size: 1.75rem;
    }

    /* Connection status optimization to save space */
    .connection-status {
        padding: 8px;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        justify-content: center;
    }

    .connection-status #db-status-text {
        display: none;
    }

    .connection-status .status-dot {
        margin: 0;
    }
    
    .table td, .table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
}