/* Color Palette: #8E7F7F, #BBAAAA, #E7D2CC, #F2E2CE, #FFF8E7 */

:root {
    --color-primary: #8E7F7F;
    --color-secondary: #BBAAAA;
    --color-accent: #E7D2CC;
    --color-light: #F2E2CE;
    --color-lightest: #FFF8E7;
    
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --gradient-secondary: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    --gradient-light: linear-gradient(135deg, var(--color-light), var(--color-lightest));
    
    --shadow-sm: 0 2px 4px rgba(142, 127, 127, 0.1);
    --shadow-md: 0 4px 12px rgba(142, 127, 127, 0.15);
    --shadow-lg: 0 8px 25px rgba(142, 127, 127, 0.2);
    
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient-light);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Navigation */
.gradient-nav {
    background: var(--gradient-primary) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
    margin: 0 2px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: white;
    overflow: hidden;
}

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

.card-header {
    background: var(--gradient-secondary);
    border-bottom: none;
    color: white;
    font-weight: 600;
}

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

.gradient-header {
    background: var(--gradient-primary);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7a6d6d, #a69999);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.gradient-btn:hover {
    background: linear-gradient(135deg, #7a6d6d, #a69999);
    color: white;
}

/* Stats Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.followers {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon.engagement {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-icon.posts {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-icon.reach {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

/* Progress Bar */
.progress-modern {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.progress-modern .progress-bar {
    background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.8));
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Achievement Badges */
.achievement-badges .badge {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 20px;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.calendar-day {
    background: white;
    padding: 12px 8px;
    min-height: 80px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    background: var(--color-lightest);
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #6c757d;
}

.calendar-day.today {
    background: var(--color-accent);
    color: white;
    font-weight: bold;
}

.calendar-day.has-post {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 12px 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.post-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
}

/* Chat */
.chat-card {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    max-height: 400px;
}

.message {
    display: flex;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: var(--gradient-primary);
    color: white;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: #007bff;
    color: white;
    margin-right: 0;
    margin-left: 12px;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
    box-shadow: var(--shadow-sm);
}

.user-message .message-content {
    background: var(--gradient-primary);
    color: white;
}

.suggestion-btn {
    text-align: left;
    border-color: var(--color-secondary);
    color: var(--color-primary);
}

.suggestion-btn:hover {
    background: var(--gradient-secondary);
    border-color: var(--color-primary);
    color: white;
}

/* AI Insights */
.ai-insight {
    padding: 1rem;
    border-radius: var(--border-radius);
    background: var(--gradient-light);
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-primary);
}

.insight-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* FAQ */
.search-box {
    margin-bottom: 2rem;
}

.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-header .accordion-button {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background: var(--gradient-primary);
    color: white;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-body {
    background: white;
    padding: 1.5rem;
}

/* Report Metrics */
.report-metric {
    padding: 2rem 1rem;
}

.report-metric i {
    margin-bottom: 1rem;
}

.report-metric h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Best Times */
.best-times {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.time-slot {
    padding: 1rem;
    background: var(--gradient-light);
    border-radius: var(--border-radius);
    text-align: center;
    border-left: 4px solid var(--color-primary);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(142, 127, 127, 0.25);
}

.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(142, 127, 127, 0.25);
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--color-lightest);
    transform: scale(1.01);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 1.5rem 0;
    background: var(--gradient-primary);
}

.gradient-footer {
    background: var(--gradient-primary);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .container-fluid {
        padding: 0 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .stat-card .card-body {
        padding: 1rem;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 8px 4px;
        font-size: 0.9rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-messages {
        max-height: 300px;
    }
    
    .report-metric {
        padding: 1rem;
    }
    
    .report-metric i {
        font-size: 2rem !important;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .nav-link {
        margin: 2px 0;
    }
}

@media (max-width: 576px) {
    .main-content {
        margin-top: 70px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
    }
    
    .calendar-grid {
        font-size: 0.8rem;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 4px 2px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .achievement-badges {
        margin-top: 1rem;
    }
    
    .achievement-badges .badge {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: var(--gradient-primary);
}

.shadow-custom {
    box-shadow: var(--shadow-md);
}

.rounded-custom {
    border-radius: var(--border-radius);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart Containers */
canvas {
    max-width: 100%;
    height: auto;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-scheduled {
    background: #fff3cd;
    color: #856404;
}

.status-published {
    background: #d1edff;
    color: #0c5460;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000;
        --color-secondary: #333;
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.5);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
