/* ============================================================
   Rozpost — Ocean Calm Theme
   Clean & minimal design system
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --accent: #93C5FD;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #0F172A;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-xs: 4px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --transition: 200ms ease;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sidebar-width: 260px;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* --- Logo --- */
.logo {
    font-size: 24px;
    letter-spacing: -1px;
    color: var(--text);
}
.logo-bold { font-weight: 800; }
.logo-light { font-weight: 300; }

/* --- Buttons --- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 10px 20px;
    transition: all var(--transition);
    font-size: 14px;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-light {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-light:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-success { background: var(--success); border: none; }
.btn-success:hover { background: #059669; }

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* --- Cards --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-body { padding: 24px; }

/* --- Forms --- */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--surface);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

/* --- Badges --- */
.badge-draft { background: var(--warning-light); color: #B45309; font-weight: 500; }
.badge-approved { background: var(--success-light); color: #065F46; font-weight: 500; }
.badge-rejected { background: var(--error-light); color: #991B1B; font-weight: 500; }
.badge-scheduled { background: var(--primary-50); color: var(--primary-dark); font-weight: 500; }
.badge-instagram { background: #FDE8E8; color: #E1306C; }
.badge-facebook { background: #E8F0FE; color: #1877F2; }
.badge-linkedin { background: #E8F0FE; color: #0A66C2; }
.badge-twitter { background: #E8F6FD; color: #1DA1F2; }
.badge-whatsapp { background: #E8F8E8; color: #25D366; }

/* --- Stat Cards --- */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* --- Sidebar (App Shell) --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}
.sidebar-nav a:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.sidebar-nav a.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-nav a i { font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-plan-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-50);
    color: var(--primary);
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

.main-content .page-header {
    margin-bottom: 24px;
}
.main-content .page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}
.main-content .page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* --- Mobile Hamburger --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 999;
    padding: 0 16px;
    align-items: center;
}
.hamburger-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

/* --- Landing Page --- */
.hero-section {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg) 100%);
}
.hero-section h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 16px;
}
.hero-section .lead {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 32px;
}

.features-section { padding: 80px 0; }
.feature-card {
    text-align: center;
    padding: 32px 24px;
}
.feature-card .feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}
.feature-card h3 { font-size: 18px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; }

/* --- Pricing Section --- */
.pricing-section { padding: 80px 0; background: var(--surface); }
.pricing-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    transition: all var(--transition);
    position: relative;
}
.pricing-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}
.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.pricing-card .price {
    font-size: 40px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.pricing-card .price-period {
    font-size: 14px;
    color: var(--text-muted);
}
.pricing-card .feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
}
.pricing-card .feature-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pricing-card .feature-list li i { color: var(--success); }

/* --- Post Cards --- */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    transition: box-shadow var(--transition);
}
.post-card:hover { box-shadow: var(--shadow); }
.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.post-card .post-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 12px;
}
.post-card .post-hashtags {
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 16px;
}
.post-card .post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Onboarding Wizard --- */
.wizard-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wizard-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all var(--transition);
}
.wizard-step-circle.active {
    background: var(--primary);
    color: white;
}
.wizard-step-circle.completed {
    background: var(--success);
    color: white;
}
.wizard-step-circle.pending {
    background: var(--border);
    color: var(--text-muted);
}
.wizard-step-label {
    font-size: 11px;
    font-weight: 600;
}
.wizard-connector {
    flex: 1;
    height: 3px;
    margin: 0 4px;
    margin-bottom: 20px;
    border-radius: 2px;
}
.wizard-connector.active { background: var(--primary); }
.wizard-connector.pending { background: var(--border); }

/* --- Tone Selector Pills --- */
.tone-pill {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    margin: 4px;
}
.tone-pill:hover { border-color: var(--primary-light); color: var(--primary); }
.tone-pill.selected {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary);
}

/* --- Platform Cards (onboarding) --- */
.platform-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 140px;
}
.platform-card:hover { border-color: var(--primary-light); }
.platform-card.selected {
    border-color: var(--primary);
    background: var(--primary-50);
}
.platform-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Loading Spinner --- */
.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}
.spinner-border { color: var(--primary); }

/* --- Content Fade --- */
.view-container {
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Tags Input --- */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    min-height: 42px;
    cursor: text;
    background: var(--surface);
}
.tags-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.tags-container .tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
}
.tags-container .tag .tag-remove {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    opacity: 0.6;
}
.tags-container .tag .tag-remove:hover { opacity: 1; }
.tags-container .tags-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    font-size: 14px;
    background: transparent;
}

/* --- Alerts --- */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
}

/* --- Tables --- */
.table {
    font-size: 14px;
}
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.table td {
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 8px;
}

/* --- Footer (Landing) --- */
.landing-footer {
    background: var(--text);
    color: var(--text-muted);
    padding: 48px 0 24px;
}
.landing-footer a { color: var(--accent); }
.landing-footer a:hover { color: white; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 32px; }
    .hero-section { padding: 80px 0 60px; }

    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }

    .mobile-header { display: flex; }
    .sidebar-overlay.show { display: block; }

    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px;
    }

    .stat-card .stat-value { font-size: 24px; }
    .pricing-card { margin-bottom: 16px; }
}

@media (max-width: 576px) {
    .hero-section h1 { font-size: 28px; }
    .post-card .post-actions { flex-direction: column; }
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --bg: #0F172A;
    --surface: #1E293B;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: #334155;
    --border-light: #1E293B;
    --primary-50: rgba(37, 99, 235, 0.15);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #1E293B;
    color: #F1F5F9;
    border-color: #334155;
}
[data-theme="dark"] .btn-light {
    background: #334155;
    color: #F1F5F9;
    border-color: #475569;
}
[data-theme="dark"] .btn-light:hover {
    background: #475569;
    color: #F1F5F9;
}
[data-theme="dark"] .table { color: #F1F5F9; }
[data-theme="dark"] .accordion-button {
    background: #1E293B;
    color: #F1F5F9;
}
[data-theme="dark"] .modal-content {
    background: #1E293B;
    color: #F1F5F9;
}
[data-theme="dark"] .dropdown-menu {
    background: #1E293B;
    border-color: #334155;
}
[data-theme="dark"] .dropdown-item {
    color: #F1F5F9;
}
[data-theme="dark"] .dropdown-item:hover {
    background: #334155;
}

/* Dark mode toggle button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.theme-toggle:hover {
    background: var(--primary-50);
    color: var(--primary);
}
