/* Modern Design Variables */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --body-bg: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--text-main);
}

/* Sidebar Styles */
.sidebar {
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f172a 100%);
    position: fixed;
    top: 0;
    left: 0;
    color: white;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar h4 {
    display: none;
    /* Hide original title if it still exists in code, though we removed it */
}

/* Logo Styles */
.sidebar-logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
}

@media (max-width: 991px) {
    .sidebar-logo {
        max-width: 120px;
    }
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.sidebar a {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar a i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Sidebar Buttons (Export/Logout) */
.sidebar button#exportData {
    width: 100%;
    margin-top: 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.sidebar button#exportData:hover {
    background: rgba(16, 185, 129, 0.2);
    color: white;
}

.sidebar .logout-wrapper {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-align: center;
    justify-content: center;
}

.sidebar .logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* Content Area */
.content {
    margin-left: 260px;
    padding: 2rem;
    transition: all 0.3s ease;
}

/* Navbar */
.navbar {
    background: white !important;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.navbar-brand {
    color: var(--text-main) !important;
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar .text-white {
    color: var(--text-main) !important;
    font-weight: 600;
}

.notification-bell {
    color: var(--text-muted);
}

.btn-outline-light {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-light:hover {
    background-color: var(--body-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-main) !important;
    /* Override specific bg colors for cleaner look */
}

/* Custom Card Headers for Statuses - simpler indicators */
.card-header.tasks-pending {
    border-left: 4px solid var(--danger-color);
}

.card-header.attention-tasks {
    border-left: 4px solid var(--warning-color);
}

.card-header.task-in-progress {
    border-left: 4px solid var(--info-color);
}

.card-header.task-published {
    border-left: 4px solid var(--success-color);
}

.card-header.total-stories {
    border-left: 4px solid var(--primary-color);
}

/* Override background colors from inline styles to white for cleaner look */
.card-header.tasks-pending,
.card-header.attention-tasks,
.card-header.task-in-progress,
.card-header.task-published,
.card-header.total-stories,
.card-header.search-by-date,
.card-header.story-board {
    background: white !important;
    color: var(--text-main) !important;
}

.card-body {
    padding: 1.5rem;
}

.card-body h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.card-body small {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Table */
.table-responsive {
    border-radius: var(--radius-lg);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    border-top: none;
}

.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.table tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 600;
    border-radius: 9999px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.bg-danger {
    background-color: #fee2e2 !important;
    color: #991b1b;
}

.bg-warning {
    background-color: #fef3c7 !important;
    color: #92400e;
}

.bg-info {
    background-color: #dbeafe !important;
    color: #1e40af;
}

.bg-success {
    background-color: #d1fae5 !important;
    color: #065f46;
}

.bg-secondary {
    background-color: #f3f4f6 !important;
    color: #374151;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border-color: var(--border-color);
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Logout Button */
.logout-btn {
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    width: auto;
}

/* Mobile & Responsive Styles */
@media (max-width: 991px) {
    .content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
        border-radius: 0;
        margin-bottom: 0;
        padding-left: 4rem;
        /* Space for toggle button */
    }

    .sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0.75rem;
        left: 1rem;
        z-index: 1001;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: transparent;
        color: var(--text-main);
        border: 1px solid var(--border-color);
        box-shadow: none;
        padding: 0;
        transition: all 0.2s ease;
    }

    .sidebar-toggle:hover {
        background: white;
        color: var(--primary-color);
    }

    /* Responsive Table as Cards */
    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        background: white;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid var(--border-color);
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .table tbody td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 1rem;
        border-top: 1px dashed var(--border-color);
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--text-muted);
        font-size: 0.85rem;
        margin-right: 1rem;
    }
}


/* Sidebar Toggle Button (Desktop Hidden) */
.sidebar-toggle {
    display: none;
}


/* Footer Styles */
.footer {
    padding: 1.5rem;
    text-align: center;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Login Page Styles */
.body-login {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
}

.login-header {
    background: #f8fafc;
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.login-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    /* Transparent on dark bg */
    color: #94a3b8;
    font-size: 0.875rem;
}

.login-footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}


.login-footer a:hover {
    color: white;
}

/* Urdu Text Style */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

.urdu-text {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Urdu Typesetting', serif;
    font-size: 1.25rem;
    line-height: 1.6;
}

/* Modern Selection Chips */
.selection-chip {
    border-radius: 50rem !important;
    /* Pill shape */
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.selection-chip:hover {
    background: rgba(79, 70, 229, 0.05);
    /* Softer hover */
    transform: translateY(-1px);
}

.selection-chip.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

/* Modern Input Fields */
.form-control-modern {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-label-modern {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}