/* assets/css/style.css - SMM Posting Tracker Modern Dark Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0b0f19;
    --card-bg: #151c2c;
    --card-border: #232d42;
    --card-hover: #1c263b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #6366f1;
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.15);
    --accent-amber: #f59e0b;
    --accent-amber-bg: rgba(245, 158, 11, 0.15);
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.15);
    --cell-bg: #1a2336;
    --cell-locked: #111827;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: rgba(21, 28, 44, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main);
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: var(--card-hover);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.user-role-tag {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-logout {
    color: var(--accent-red);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Main Container */
.container {
    flex: 1;
    padding: 2rem;
    max-width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Form Controls & Buttons */
.form-select, .form-input {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    outline: none;
    transition: border 0.2s ease;
}

.form-select:focus, .form-input:focus {
    border-color: var(--accent-blue);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

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

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

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

/* Matrix Table Wrapper */
.matrix-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    max-height: calc(100vh - 220px);
}

.matrix-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}

.matrix-table th, .matrix-table td {
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    text-align: center;
    padding: 0.4rem 0.5rem;
}

.matrix-table th {
    background: #192236;
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
}

.matrix-table th.col-sticky-1 {
    left: 0;
    z-index: 20;
    text-align: left;
    min-width: 160px;
}

.matrix-table th.col-sticky-2 {
    left: 160px;
    z-index: 20;
    text-align: left;
    min-width: 130px;
}

.matrix-table th.col-sticky-3 {
    left: 290px;
    z-index: 20;
    text-align: center;
    min-width: 75px;
}

.matrix-table td.col-sticky-1 {
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 5;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
}

.matrix-table td.col-sticky-2 {
    position: sticky;
    left: 160px;
    background: var(--card-bg);
    z-index: 5;
    text-align: left;
    color: var(--accent-blue);
    font-size: 0.78rem;
}

.matrix-table td.col-sticky-3 {
    position: sticky;
    left: 290px;
    background: var(--card-bg);
    z-index: 5;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Row Labels */
.row-label-type {
    color: var(--accent-purple);
    background: rgba(99, 102, 241, 0.1);
}

.row-label-status {
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.1);
}

/* Grid Cell Styles */
.cell-editable {
    background: var(--cell-bg);
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 58px;
    height: 34px;
    vertical-align: middle;
}

.cell-editable:hover {
    background: #25314a;
}

/* Post Badges */
.badge-type {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.72rem;
}

.badge-ST { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-CA { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-RE { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-OD { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-NC { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

/* Status Badges */
.badge-status-posted {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cell-locked {
    background: var(--cell-locked) !important;
    cursor: not-allowed;
    opacity: 0.9;
}

.cell-planning-locked {
    background: rgba(31, 41, 55, 0.4) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.lock-icon {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Login Page Layout */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .brand-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-blue);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.alert-danger {
    background: var(--accent-red-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: var(--accent-green-bg);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Modal Popovers */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.modal-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--card-border);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

/* Status Badge Pills */
.badge-status-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.72rem;
    text-align: center;
}

.badge-status-pending {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-status-scheduled {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Custom Premium Dark Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0b0f19; /* Matches --bg-dark */
}

::-webkit-scrollbar-thumb {
    background: #232d42; /* Matches --card-border */
    border-radius: 5px;
    border: 2px solid #0b0f19;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b82f6; /* Matches --accent-blue */
}

/* Firefox compatibility */
* {
    scrollbar-width: thin;
    scrollbar-color: #232d42 #0b0f19;
}

/* Sunday (Agency Off-day) Styling */
.matrix-table th.cell-sunday {
    background: #27161b !important;
    color: #f87171 !important;
    border-bottom: 2px solid rgba(239, 68, 68, 0.4) !important;
}

.matrix-table td.cell-sunday {
    background: rgba(239, 68, 68, 0.04) !important;
    border-left: 1px dashed rgba(239, 68, 68, 0.15) !important;
    border-right: 1px dashed rgba(239, 68, 68, 0.15) !important;
}

