/* Root styling and Theme Variables */
:root {
    --primary-color: #2C3E50; /* Navy Blue */
    --accent-color: #D68910;  /* Orange/Gold Accent */
    --bg-light: #F5F5F5;      /* Light Off-white */
    --card-bg: #FFFFFF;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --border-color: #E2E8F0;
    --sidebar-w: 260px;
    --font-stack: 'Outfit', sans-serif;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --border-radius: 12px;
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-w);
    background-color: var(--primary-color);
    color: #F8FAFC;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
}

.sidebar-header {
    margin-bottom: 3rem;
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
}

.sidebar-logo {
    width: 100%;
    max-width: 110px;
    height: auto;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    font-weight: 500;
    color: #94A3B8;
}

.sidebar-nav li a:hover {
    color: #FFFFFF;
    background-color: rgba(255,255,255,0.05);
}

.sidebar-nav li.active a {
    color: #FFFFFF;
    background-color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(214, 137, 16, 0.3);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
}

.sidebar-footer p {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-bottom: 1rem;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(255,255,255,0.05);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.08);
}

.profile-badge i {
    font-size: 1.25rem;
    color: var(--accent-color);
}

.profile-badge h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-badge span {
    font-size: 0.75rem;
    color: #94A3B8;
}

/* Print header hidden by default on screen */
.print-only-header {
    display: none;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2.5rem;
    background-color: var(--bg-light);
    min-width: 0;
}

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

.header-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.header-subtitle-wrapper {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.header-profile-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-stat-item strong {
    color: var(--primary-color);
}

.schedule-badge {
    background-color: rgba(214, 137, 16, 0.08);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px dashed var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background-color: #1A252F;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-secondary {
    background-color: #FFFFFF;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    margin-right: 0.5rem;
}

.btn-secondary:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

/* Dashboard Body Scroll Padding */
.dashboard-body {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* KPI Summary Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
}

.kpi-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.icon-blue, 
.icon-orange, 
.icon-gold, 
.icon-navy, 
.icon-calendar { 
    background-color: rgba(44, 62, 80, 0.08); 
    color: #34495E; 
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Insight Auto-generated Banner */
.insight-banner {
    background-color: rgba(214, 137, 16, 0.08);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.insight-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 0.1rem;
    animation: pulse 2s infinite ease-in-out;
}

.insight-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.insight-content p {
    font-size: 0.9rem;
    color: #4A5568;
    line-height: 1.4;
}

/* Charts Layout Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.card-double {
    grid-column: span 2;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.chart-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-container-donut {
    position: relative;
    height: 250px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Data Tables & Comments Section Grid */
.data-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.data-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.data-header {
    margin-bottom: 1.25rem;
}

.data-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Data Table Styling */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #F8FAFC;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background-color: rgba(44, 62, 80, 0.02);
}

.post-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-photo { background-color: rgba(138, 155, 168, 0.1); color: #8A9BA8; }
.badge-reel { background-color: rgba(86, 101, 115, 0.1); color: #566573; }
.badge-carousel { background-color: rgba(44, 62, 80, 0.1); color: #2C3E50; }

.text-bold { font-weight: 700; }
.text-gold { color: var(--accent-color); }
.text-blue { color: #2980B9; }

.table-link {
    color: #2980B9;
    font-weight: 600;
}
.table-link:hover {
    text-decoration: underline;
}

.caption-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Comments Feed */
.comments-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.comment-item {
    background-color: #F8FAFC;
    border-radius: 8px;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.comment-author {
    font-weight: 700;
    color: var(--primary-color);
}

.comment-date {
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.85rem;
    color: #4A5568;
    word-break: break-word;
}

.no-comments-badge {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.85rem;
}

/* Custom Scrollbar for comments */
.comments-feed::-webkit-scrollbar {
    width: 6px;
}
.comments-feed::-webkit-scrollbar-track {
    background: #F8FAFC;
}
.comments-feed::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 3px;
}
.comments-feed::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive Styling */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .card-double {
        grid-column: span 1;
    }
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .data-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        padding: 0.75rem 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .sidebar-header {
        margin-bottom: 0;
    }
    
    .logo-wrapper {
        padding: 0;
    }
    
    .sidebar-logo {
        max-height: 36px;
        width: auto;
        max-width: none;
    }
    
    .sidebar-nav {
        margin-left: 1.5rem;
        flex: 1;
        overflow-x: auto;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar-nav ul {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.25rem 0;
    }
    
    .sidebar-nav li a {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        gap: 0.5rem;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem 1rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .kpi-card {
        padding: 1rem;
    }
}

@media (max-width: 500px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .header-subtitle-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .header-profile-info {
        gap: 0.5rem 1rem;
    }
}

/* Competitor Analysis and AI Content Assistant Styles */
.competitor-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.competitor-card {
    background-color: #F8FAFC;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

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

.comp-header h4 {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.comp-link {
    font-size: 0.8rem;
    color: #2980B9;
    font-weight: 600;
}

.comp-link:hover {
    text-decoration: underline;
}

.comp-body p {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.comp-body p:last-child {
    margin-bottom: 0;
}

.comp-pro strong {
    color: #2E7D32;
}

.comp-opportunity strong {
    color: #D68910;
}

.ai-assistant-body {
    display: flex;
    flex-direction: column;
}

.ai-intro {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.generated-idea-card {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
}

.idea-type-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.idea-day-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    background-color: rgba(214,137,16,0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.idea-section {
    margin-top: 0.75rem;
}

/* Print Stylesheet for Report Export */
@page {
    size: auto;
    margin: 0mm; /* completely removes default browser header and footer */
}

@media print {
    body {
        background-color: #FFFFFF !important;
        color: #000000 !important;
        font-size: 11pt;
        margin: 15mm !important; /* adds inner page padding since page margin is 0 */
    }
    
    .sidebar,
    .header-actions,
    .insight-banner,
    .comments-feed::-webkit-scrollbar,
    .table-link i,
    #btn-generate-idea,
    .ai-intro {
        display: none !important;
    }
    
    .app-container {
        display: block !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background-color: #FFFFFF !important;
    }
    
    /* Print Header Logo styling */
    .print-only-header {
        display: flex !important;
        justify-content: center;
        align-items: center;
        margin-bottom: 2rem !important;
    }
    
    .print-logo {
        width: 140px !important;
        height: auto !important;
    }
    
    .header {
        border-bottom: 2px solid #2C3E50 !important;
        margin-bottom: 2rem !important;
        padding-bottom: 1rem !important;
    }
    
    .header-title h1 {
        font-size: 20pt !important;
        text-align: center !important;
    }
    
    .header-subtitle-wrapper {
        justify-content: center !important;
    }
    
    .schedule-badge {
        border: 1px solid #2C3E50 !important;
        background-color: #F5F5F5 !important;
        color: #2C3E50 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0.5rem !important;
        margin-bottom: 2rem !important;
    }
    
    .kpi-card {
        padding: 0.75rem !important;
        border: 1px solid #CBD5E1 !important;
        box-shadow: none !important;
        background-color: #FFFFFF !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .kpi-value {
        font-size: 14pt !important;
        color: #2C3E50 !important;
    }
    
    .kpi-icon {
        background-color: #F1F5F9 !important;
        color: #2C3E50 !important;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        page-break-inside: auto;
    }
    
    .chart-card {
        grid-column: span 1 !important;
        page-break-inside: avoid !important;
        page-break-after: auto;
        border: 1px solid #CBD5E1 !important;
        box-shadow: none !important;
        margin-bottom: 1rem !important;
    }
    
    .chart-container,
    .chart-container-donut {
        height: 200px !important;
    }
    
    .data-section {
        grid-template-columns: 1fr !important;
        page-break-inside: auto;
    }
    
    .data-card {
        grid-column: span 1 !important;
        page-break-inside: avoid !important;
        border: 1px solid #CBD5E1 !important;
        box-shadow: none !important;
    }
    
    .text-gold, .text-bold.text-gold {
        color: #2C3E50 !important;
    }
    
    .comments-feed {
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .comment-item {
        border: 1px solid #E2E8F0 !important;
        background-color: #FFFFFF !important;
        page-break-inside: avoid !important;
    }
}
