/**
 * Modern Light Theme Dashboard - UNIFIED STYLE
 * Версия 3.5 - TSK-STYLE-UNIFY-01
 * Production-ready code with a single light theme design system. Dark theme removed for consistency.
 */

/* ========================================================================
   Design tokens moved to static/css/variables.css
   ======================================================================== */

/* ========================================================================
   CITIZEN SPECIFIC LAYOUT & COMPONENTS
   ======================================================================== */

.header-weather {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    width: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}
.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}
.action-btn.active { background-color: var(--primary-light); border-color: var(--primary); }
.action-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.action-btn.disabled:hover { transform: none; background: var(--bg-card); border-color: var(--border); box-shadow: var(--shadow-sm); }

/* Project and Event Cards */
.project-card, .event-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: var(--transition);
}
.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.project-title {
    margin-bottom: 1rem;
}
.project-funding-progress {
    margin-bottom: 1rem;
}
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}
.progress-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.project-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}
.card-meta { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.meta-tag { font-size: 0.75rem; color: var(--text-muted); }
.event-date { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.apply-btn { margin-top: auto; }

/* Project Details Content Styles */
.project-details-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}
.project-details-content h4:first-child {
    margin-top: 0;
}
.markdown-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
}
.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.team-member {
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
}

.global-author-credit {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 2rem auto 1rem;
    padding: 0.5rem;
}

.global-author-credit a {
    color: var(--primary);
    text-decoration: none;
}

.global-author-credit a:hover {
    text-decoration: underline;
}

/* View Panes */
.view-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: opacity 0.3s, visibility 0.3s;
}
.view-pane.active { opacity: 1; visibility: visible; display: block; }
#map-pane { overflow: hidden; }
#report-pane, #social-pane, #ai-pane, #stories-pane { overflow-y: auto; }

/* Map Styles */
#citizenMap { width: 100%; height: 100%; }
.custom-popup h4 { margin: 0 0 0.5rem 0; color: var(--primary); }
.custom-map-icon {
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--bg-elevated);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.custom-map-icon.pride { background: color-mix(in srgb, var(--danger) 12%, var(--bg-primary)); border: 2px solid #ec4899; }
.custom-map-icon.crime { background: #fef2f2; border: 2px solid #dc2626; }
.custom-map-icon.eco { background: #f0fdf4; border: 2px solid #16a34a; }
.comment-marker-wrapper { display: flex; align-items: center; justify-content: center; }
.comment-marker {
    font-size: 1.25rem;
    background: var(--bg-elevated);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--primary);
}

.map-icon.project {
    border-color: var(--primary);
}

/* Leaflet Popup Styles — see components/map-popups.css */

/* Feed Styles */
.feed-container { max-width: 800px; margin: 0 auto; padding: 1.5rem; }
.feed-item {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out both;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.feed-item:hover {
    background: var(--bg-hover);
    border-color: var(--secondary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}
.feed-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.feed-source { font-size: 0.813rem; font-weight: 600; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.feed-date { font-size: 0.75rem; color: var(--text-muted); }
.feed-text { font-size: 0.938rem; color: var(--text-secondary); line-height: 1.5; }
.feed-item.with-image { display: flex; gap: 1rem; align-items: flex-start; }
.feed-image { flex-shrink: 0; width: 120px; height: 90px; overflow: hidden; border-radius: var(--radius-md); background: var(--bg-tertiary); }
.feed-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.feed-item:hover .feed-image img { transform: scale(1.05); }
.feed-content { flex: 1; min-width: 0; }
.feed-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0.5rem 0; line-height: 1.3; }
.story-item .cultural-codes { margin-top: 1rem; padding-top: 0.5rem; border-top: 1px dashed var(--border-light); }
.cultural-code-tag { display: inline-block; background-color: var(--primary-light); color: var(--primary-dark); padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 500; margin: 0 0.5rem 0.5rem 0; }

/* === ОБНОВЛЕННЫЕ СТИЛИ AI-PANE === */
#ai-pane {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
}

.llm-response-area {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.llm-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.llm-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    flex-basis: 200px;
    flex-grow: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.llm-btn span {
    font-size: 1.25rem !important;
    margin-bottom: 0 !important;
}

.llm-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.llm-export-controls {
    width: 100%;
    max-width: 900px;
    text-align: right;
}

.llm-response-content { white-space: pre-wrap; }
.llm-response-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.llm-response-content th, .llm-response-content td { border: 1px solid var(--border-light); padding: 0.5em; }
.llm-response-content th { background-color: var(--bg-hover); }
.llm-response-content h1, .llm-response-content h2, .llm-response-content h3 { margin-top: 1rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.llm-response-content ul, .llm-response-content ol { margin-left: 1.5rem; }
.llm-response-content dl { margin: 1rem 0; }
.llm-response-content dt { font-weight: bold; color: var(--text-primary); margin-top: 1rem; }
.llm-response-content dd { margin-left: 1.5rem; margin-top: 0.5rem; color: var(--text-secondary); }

/* Report Styles */
.report-container { padding: 1.5rem; background: var(--bg-primary); min-height: 100%; }
.report-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border); }
#llm-summary-container { background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%); border: 2px solid var(--primary-light); border-radius: var(--radius-xl); padding: 2rem; margin-bottom: 2rem; min-height: 300px; max-height: 600px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.llm-summary-content p { margin-bottom: 1.25rem; text-align: justify; }
.llm-summary-content > * + h2 { margin-top: 2.5rem; }
.dashboard-grid-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem; }
.analysis-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); animation: fadeInUp 0.5s ease-out forwards; opacity: 0; }
.chart-container { position: relative; height: 300px; margin-top: 1rem; }
.wordcloud-container { width: 100%; height: 300px; margin-top: 1rem; }
blockquote { font-style: italic; color: var(--text-secondary); border-left: 3px solid var(--primary); padding-left: 1rem; margin: 1rem 0; }

/* Добавляем анимацию для маркеров */
@keyframes markerPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.custom-map-icon:hover {
    animation: markerPulse 1s ease-in-out infinite;
    cursor: pointer;
}

.news-marker-wrapper {
    animation: pulse-full 2s infinite;
}

.news-marker {
    font-size: 1.5rem;
    background: var(--bg-elevated);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--info);
}

/* @keyframes fadeInUp, pulse — moved to components/animations.css */

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

/* Loading overlay/spinner moved to static/css/components/loading.css */

/* Error and Info States */
.error-message {
    color: var(--danger);
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    text-align: center;
}

.info-placeholder {
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
    font-style: italic;
}

/* Sentiment Sliders */
.sentiment-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #ef4444, #f59e0b, #10b981);
    outline: none;
    transition: opacity 0.2s;
}

.sentiment-slider:hover {
    opacity: 0.8;
}

.sentiment-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.sentiment-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.sentiment-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.sentiment-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-main { flex-direction: column; }
    .dashboard-sidebar-left, .dashboard-sidebar-right {
        width: 100%;
        max-height: 30vh;
        border: none;
    }
    .dashboard-sidebar-left { border-bottom: 1px solid var(--border); }
    .dashboard-sidebar-right { border-top: 1px solid var(--border); }
}

@media (max-width: 768px) {
    :root { --sidebar-left-width: 280px; }

    .dashboard-sidebar-left, .dashboard-sidebar-right {
        position: fixed;
        left: -100%;
        height: 100vh;
        z-index: 1500;
        transition: left 0.3s;
        box-shadow: var(--shadow-lg);
        max-height: 100vh;
    }

    .dashboard-sidebar-right {
        left: auto;
        right: -100%;
        transition: right 0.3s;
    }

    .dashboard-sidebar-left.open { left: 0; }
    .dashboard-sidebar-right.open { right: 0; }

    .llm-buttons { grid-template-columns: 1fr; }
    .dashboard-grid-inner { grid-template-columns: 1fr; }
    .feed-item.with-image { flex-direction: column; }
    .feed-image { width: 100%; height: 200px; }
}

/* Print Styles */
@media print {
    .dashboard-sidebar-left,
    .dashboard-sidebar-right,
    .view-switcher,
    .action-buttons-container,
    .control-panel,
    .stats-panel,
    .legend {
        display: none !important;
    }

    .dashboard-content {
        width: 100% !important;
        margin: 0 !important;
    }

    .analysis-card {
        page-break-inside: avoid;
    }
}