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

:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Layout */
    --sidebar-width: 260px;
    --top-bar-height: 64px;
    
    /* Transitions */
    --transition: all 0.2s ease;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
    overflow: hidden;
}

/* Layout */
body {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}
.logo i {
    color: var(--primary);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    color: var(--gray-900);
    background: var(--gray-50);
}

.nav-item.active {
    color: var(--primary);
    background: var(--gray-50);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}
/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.sync-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}

.sync-button:hover {
    background: var(--gray-200);
}

.sync-button.syncing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    height: var(--top-bar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.top-bar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

/* Views Container */
.views-container {
    flex: 1;
    overflow: auto;
    padding: 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}
/* Dashboard */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 0.5rem;
    font-size: 1.25rem;
    color: var(--primary);
}
.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.recent-content, .mini-calendar-widget {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.recent-content h2, .mini-calendar-widget h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}
    color: var(--gray-900);
}

.content-item-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.content-item-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.content-item-type.post {
    background: var(--primary);
}

.content-item-type.reel {
    background: var(--warning);
}

.content-item-type.story {
    background: var(--success);
}
.content-item-type.carousel {
    background: var(--secondary);
}

/* Mini Calendar */
.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.mini-calendar-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
    padding: 0.5rem;
}

.mini-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: var(--transition);
}
.mini-calendar-day:hover {
    background: var(--gray-100);
}

.mini-calendar-day.today {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.mini-calendar-day.has-content {
    position: relative;
}

.mini-calendar-day.has-content::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.mini-calendar-day.other-month {
    color: var(--gray-400);
}

/* Calendar View */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-nav h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.calendar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.view-toggle .btn-icon {
    background: transparent;
    border: none;
}

.view-toggle .btn-icon.active {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}
/* Calendar Container */
.calendar-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    height: calc(100vh - var(--top-bar-height) - 8rem);
}

.calendar-header-day {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
}

.calendar-header-day:last-child {
    border-right: none;
}

.calendar-day {
    min-height: 120px;
    padding: 0.75rem;
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
    position: relative;
}
.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.other-month {
    background: var(--gray-50);
}

.calendar-day.today {
    background: var(--primary-hover) 0.05;
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.calendar-day.today .calendar-day-number {
    color: var(--primary);
    font-weight: 600;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-event {
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
}
.calendar-event:hover {
    transform: translateX(2px);
}

.calendar-event.post {
    background: var(--primary);
}

.calendar-event.reel {
    background: var(--warning);
}

.calendar-event.story {
    background: var(--success);
}

.calendar-event.carousel {
    background: var(--secondary);
}

/* Table View */
.table-toolbar {
    margin-bottom: 1.5rem;
}

.table-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}
.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--white);
    cursor: pointer;
}
/* Table Container */
.table-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.content-table th {
    background: var(--gray-50);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.content-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.content-table th.sortable:hover {
    background: var(--gray-100);
}
.content-table th i {
    margin-left: 0.5rem;
    color: var(--gray-400);
    font-size: 0.75rem;
}

.content-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

.content-table tr:hover td {
    background: var(--gray-50);
}

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

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-badge.draft {
    background: var(--gray-100);
    color: var(--gray-700);
}
.status-badge.scheduled {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.status-badge.published {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.table-actions button:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}
/* Settings */
.settings-container {
    max-width: 800px;
}

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

.settings-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.settings-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.google-auth-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}
.google-auth-status.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.sheet-config {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.sheet-config label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.sheet-config input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}
/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 0.75rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}
.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 999;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}