/**
 * SocialPilot - SaaS Stylesheet
 * Clean, professional, modern social media management theme
 */

:root {
    --sp-primary: #1877f2;
    --sp-primary-hover: #1465cc;
    --sp-sidebar-width: 260px;
    --sp-sidebar-bg: #0f172a;
    --sp-sidebar-text: #94a3b8;
    --sp-sidebar-hover: #1e293b;
    --sp-sidebar-active: #2563eb;
    --sp-bg-main: #f8fafc;
    --sp-card-border: #e2e8f0;
    --sp-text-main: #1e293b;
    --sp-text-muted: #64748b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--sp-bg-main);
    color: var(--sp-text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sp-sidebar-width);
    background-color: var(--sp-sidebar-bg);
    color: var(--sp-sidebar-text);
    min-height: 100vh;
    transition: all 0.3s ease;
    z-index: 1040;
}

#sidebar .brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

#sidebar .nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 1.2rem 1.5rem 0.4rem;
    font-weight: 600;
}

#sidebar .nav-link {
    color: var(--sp-sidebar-text);
    padding: 0.7rem 1.25rem;
    margin: 0.15rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

#sidebar .nav-link i {
    font-size: 1.15rem;
}

#sidebar .nav-link:hover {
    color: #ffffff;
    background-color: var(--sp-sidebar-hover);
}

#sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--sp-sidebar-active);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#sidebar .nav-link .badge {
    margin-left: auto;
    font-size: 0.75rem;
}

/* Main Content Area */
#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--sp-card-border);
    padding: 0.75rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Metric Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--sp-card-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Custom Cards */
.card-saas {
    background: #ffffff;
    border: 1px solid var(--sp-card-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.card-saas .card-header {
    background: transparent;
    border-bottom: 1px solid var(--sp-card-border);
    padding: 1.1rem 1.5rem;
    font-weight: 600;
}

/* Facebook Feed Mockup Preview */
.fb-preview-card {
    background: #ffffff;
    border: 1px solid #ced0d4;
    border-radius: 8px;
    max-width: 500px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fb-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.fb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    font-weight: bold;
}

.fb-author-name {
    font-weight: 600;
    font-size: 15px;
    color: #050505;
    line-height: 1.2;
}

.fb-timestamp {
    font-size: 13px;
    color: #65676b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fb-preview-body {
    padding: 4px 16px 12px;
    font-size: 15px;
    color: #050505;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 24px;
}

.fb-preview-media-container {
    background: #f0f2f5;
    border-top: 1px solid #ced0d4;
    border-bottom: 1px solid #ced0d4;
    overflow: hidden;
    position: relative;
    max-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-preview-media-container img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
}

.fb-preview-media-container video {
    width: 100%;
    max-height: 420px;
}

.fb-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    width: 100%;
}

.fb-grid-2 img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.fb-preview-link-box {
    border-top: 1px solid #ced0d4;
    border-bottom: 1px solid #ced0d4;
    background: #f0f2f5;
    padding: 10px 16px;
    cursor: pointer;
}

.fb-link-domain {
    font-size: 12px;
    color: #65676b;
    text-transform: uppercase;
}

.fb-link-title {
    font-size: 15px;
    font-weight: 600;
    color: #050505;
    margin-top: 2px;
}

.fb-preview-footer {
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    border-top: 1px solid #ced0d4;
    color: #65676b;
    font-weight: 600;
    font-size: 14px;
}

.fb-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* Status Badges */
.badge-status {
    padding: 0.35em 0.7em;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-scheduled { background-color: #dbeafe; color: #1e40af; }
.badge-published { background-color: #dcfce7; color: #166534; }
.badge-partially_published { background-color: #ccfbf1; color: #115e59; }
.badge-failed { background-color: #fee2e2; color: #991b1b; }
.badge-draft { background-color: #f1f5f9; color: #475569; }
.badge-processing { background-color: #ffedd5; color: #9a3412; }
.badge-cancelled { background-color: #e2e8f0; color: #334155; }

/* Upload Area */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.upload-dropzone:hover {
    border-color: var(--sp-primary);
    background-color: #f0f7ff;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1090;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sp-sidebar-width));
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
    }
    #sidebar.show {
        margin-left: 0;
    }
}
