:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #6366F1;
    --primary-hover: #4F46E5;
    --secondary-color: #9CA3AF;
    --success-color: #34D399;
    --danger-color: #F87171;
    --warning-color: #FBBF24;
    --background: #111827;
    --surface: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --border-color: #374151;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

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

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
    height: 100%;
}

#mainContent {
    width: 100%;
    height: 100vh;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    height: 100%;
    z-index: 50;
}

.auth-container {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    margin: auto;
}

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

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Navigation */
.navbar {
    background: var(--surface);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-items {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--background);
}

.nav-username {
    color: var(--text-primary);
    font-weight: 500;
}

.nav-team-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.user-menu-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
}

.nav-username {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-toggle:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    min-width: 220px;
    overflow: hidden;
    z-index: 1000;
}

.team-select-section {
    padding: 0.5rem 0;
}

.team-option {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 400;
    text-align: left;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.team-option:hover {
    background: var(--background);
}

.team-option.active {
    background: var(--primary-color);
    color: white;
}

.team-option-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.team-option-member {
    font-size: 0.8rem;
    opacity: 0.8;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: var(--background);
}

.logout-item {
    color: #EF4444;
    border-top: 1px solid var(--border-color);
}

.logout-item:hover {
    background: #FEE2E2;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

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

.nav-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Tab Buttons */
.tab-buttons {
    display: flex;
    gap: 0.5rem;
    background: var(--background);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

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

.tab-btn.active {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: var(--shadow);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

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

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.form-select {
    background: var(--surface);
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    width: auto;
}

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

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

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4B5563;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Instagram Connection Status */
.ig-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ig-status-icon {
    width: 48px;
    height: 48px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    border-left: 4px solid transparent;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Post card color variations */
.post-card-scheduled {
    border-left-color: #3B82F6;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), var(--surface));
}

.post-card-published {
    border-left-color: #10B981;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), var(--surface));
}

.post-card-failed {
    border-left-color: #EF4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), var(--surface));
}

.post-card-draft {
    border-left-color: #9CA3AF;
}

.post-card-instagram {
    border-left-color: #9CA3AF;
    background: linear-gradient(to right, rgba(156, 163, 175, 0.05), var(--surface));
    opacity: 0.85;
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #ffffff;
    display: block;
}

.post-content {
    padding: 1rem;
}

.post-caption {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.post-caption-text {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-indicators {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.post-indicator {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.indicator-postwave {
    background: #D1FAE5;
    color: #065F46;
}

.indicator-failed {
    background: #FEE2E2;
    color: #991B1B;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.post-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft {
    background: #F3F4F6;
    color: var(--text-secondary);
}

.status-scheduled {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-published {
    background: #D1FAE5;
    color: #065F46;
}

.status-failed {
    background: #FEE2E2;
    color: #991B1B;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.post-actions button,
.post-actions a.btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    height: 38px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Post Editor */
.post-editor {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.editor-main {
    min-width: 0;
}

.editor-preview {
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Media Preview */
.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: start;
    transition: opacity 0.15s ease;
}

.media-preview.reordering {
    opacity: 0.6;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: var(--surface);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-color);
    opacity: 0.1;
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.drop-zone-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.drop-zone-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Drop zone for media upload */
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
}

.character-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Instagram Preview */
.instagram-preview {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.ig-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.ig-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f09433;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.ig-username {
    font-weight: 600;
    font-size: 0.875rem;
}

.ig-images {
    width: 100%;
    aspect-ratio: 1;
    background: var(--background);
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.ig-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.ig-caption {
    padding: 0.75rem;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ig-date {
    padding: 0 0.75rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Upcoming Posts */
.upcoming-post {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
}

.upcoming-post:last-child {
    margin-bottom: 0;
}

.upcoming-post-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.upcoming-post-info {
    flex: 1;
}

.upcoming-post-time {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upcoming-post-caption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 0.75rem;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.modal-body {
    padding: 1.5rem;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.media-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Info Box */
.info-box {
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
}

.info-box ol {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.info-box li {
    margin-bottom: 0.25rem;
}

/* Utilities */
.text-muted {
    color: var(--text-secondary);
}

.filter-group {
    display: flex;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .post-editor {
        grid-template-columns: 1fr;
    }
    
    .editor-preview {
        position: static;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-items {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .nav-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.8rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .view-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-editor {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .drop-zone {
        padding: 1.5rem;
    }
    
    .drop-zone-icon {
        font-size: 2rem;
    }
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

[data-theme="dark"] .alert-error {
    background-color: #7F1D1D;
    color: #FCA5A5;
    border: 1px solid #991B1B;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

[data-theme="dark"] .alert-success {
    background-color: #064E3B;
    color: #6EE7B7;
    border: 1px solid #065F46;
}

[data-theme="dark"] .logout-item:hover {
    background: #7F1D1D;
}

/* View Header Flex */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h1 {
    margin: 0;
}
/* Week Calendar */
.week-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.week-nav-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.week-nav-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.week-nav-btn:active {
    transform: scale(0.98);
}

.week-month-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
    text-align: center;
}

.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.week-calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--surface);
    position: relative;
}

.week-calendar-day:hover:not(.disabled) {
    border-color: var(--primary-color);
    background-color: var(--surface);
}

.week-calendar-day.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.week-calendar-day.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
}

[data-theme="dark"] .week-calendar-day.disabled {
    background-color: #2a2a2a;
}

.week-calendar-day .day-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.week-calendar-day .day-number {
    font-size: 1.25rem;
    font-weight: 700;
}

.week-calendar-day .month-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.week-calendar-day .scheduled-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--warning-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
}

[data-theme="dark"] .week-calendar-day {
    background-color: var(--surface);
}

[data-theme="dark"] .week-calendar-day:hover:not(.disabled) {
    background-color: var(--surface);
}

/* Time Period Selector */
.time-period-selector {
    display: flex;
    flex-direction: column;
}

.time-period-selector select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.time-period-selector select:hover {
    border-color: var(--primary-color);
}

.time-period-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Aspect Ratio Selector */
.aspect-ratio-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.aspect-ratio-select:hover {
    border-color: var(--primary-color);
}

.aspect-ratio-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Carousel Container */
.ig-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.2s;
}

.carousel-indicator.active {
    background-color: white;
}

/* Media Preview with Reordering */
.media-preview-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0.5rem;
    border-radius: 0.5rem;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: 2px solid transparent;
}

.media-preview-item img {
    width: 150px;
    height: 150px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.media-preview-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.875rem;
    z-index: 10;
}

.media-preview-remove:hover {
    background: var(--danger-color-dark);
}

.crop-badge {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.media-preview-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.25rem;
    border-radius: 0 0 0.5rem 0.5rem;
}

.media-reorder-btn {
    background-color: transparent;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.media-reorder-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.media-preview-remove {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.media-preview-remove:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Reorder controls */
.media-reorder-controls {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    padding: 0.5rem 0 0 0;
    border-radius: 0;
    backdrop-filter: none;
    width: 100%;
}

.media-move-btn {
    background-color: rgba(79, 70, 229, 0.8);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.media-move-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.media-move-btn:disabled {
    background-color: rgba(107, 114, 128, 0.4);
    cursor: not-allowed;
    opacity: 0.5;
}

.media-move-btn:active:not(:disabled) {
    transform: translateY(0);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scaleY(0.8);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes slideInIndicator {
    from {
        opacity: 0;
        transform: scaleY(0.5);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes reorder {
    from {
        opacity: 0.7;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.media-preview-item.reordering {
    animation: reorder 0.3s ease-out;
}

/* Aspect Ratio Wrapper */
.aspect-ratio-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.aspect-ratio-select,
.custom-aspect-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
}

.custom-aspect-input {
    min-width: 150px;
}

/* Crop Modal */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.crop-modal-content {
    background-color: var(--surface);
    border-radius: 0.5rem;
    max-width: 750px;
    width: 95%;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.crop-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.crop-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-modal-close:hover {
    background-color: var(--background);
    border-radius: 0.25rem;
}

.crop-modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow: auto;
}

.crop-container {
    position: relative;
    width: 100%;
    height: 450px;
    background-color: #000;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.crop-box {
    position: absolute;
    border: 2px solid #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    box-sizing: border-box;
    cursor: move;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4);
}

.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 2px;
    box-sizing: border-box;
}

.crop-handle-nw {
    top: -6px;
    left: -6px;
    cursor: nwse-resize;
}

.crop-handle-ne {
    top: -6px;
    right: -6px;
    cursor: nesw-resize;
}

.crop-handle-sw {
    bottom: -6px;
    left: -6px;
    cursor: nesw-resize;
}

.crop-handle-se {
    bottom: -6px;
    right: -6px;
    cursor: nwse-resize;
}
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
}

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.crop-modal-footer .btn {
    min-width: 100px;
}

/* Media Preview Container with Aspect Ratio */
.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
    min-height: 150px;
}

.media-preview-item {
    position: relative;
    cursor: move;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    overflow: hidden;
    width: 150px;
    aspect-ratio: 1;
}

.media-preview-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
}