/*
 * BizFlow Business Analytics Styles
 * Complete styling for business analytics dashboard
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container Layout */
.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    padding: 1.5rem 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 100;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: -1px;
    margin-bottom: 0;
}

.nav-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    text-decoration: none;
    color: #000000;
    width: 100%;
    box-sizing: border-box;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-left-color: #000000;
    transform: translateX(5px);
    text-decoration: none;
}

.nav-item.active .nav-link {
    background-color: rgba(0, 0, 0, 0.15);
    border-left-color: #000000;
    transform: translateX(5px);
}

.nav-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
    color: #000000;
    transition: transform 0.15s ease;
}

.nav-text {
    font-size: 1rem;
    font-weight: 500;
    color: #000000;
    transition: color 0.15s ease;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    background-color: #000000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Analytics Header */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title-section h1 {
    font-size: 3rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 0.25rem;
    letter-spacing: -1px;
}

.page-subtitle {
    color: #888888;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.analytics-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.period-selector {
    background-color: #333333;
    border: 1px solid #555555;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
    min-width: 150px;
}

.period-selector:focus {
    outline: none;
    border-color: #f1c40f;
}

.period-selector option {
    background-color: #333333;
    color: #ffffff;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.3);
}

.btn-secondary {
    background: #333333;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #555555;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

.btn-icon {
    font-size: 1rem;
}

/* KPI Section */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: linear-gradient(135deg, #1a1a1a, #333333);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #555555;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.kpi-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f1c40f;
    display: block;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-change {
    font-size: 0.9rem;
    font-weight: 500;
}

.kpi-change.positive {
    color: #2ecc71;
}

.kpi-change.negative {
    color: #e74c3c;
}

/* Analytics Charts Grid */
.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background-color: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333333;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

.chart-container.large {
    grid-column: span 8;
}

.chart-container.medium {
    grid-column: span 4;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #333333;
    background-color: #1a1a1a;
}

.chart-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chart-type-selector,
.metric-selector {
    background-color: #333333;
    border: 1px solid #555555;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
}

.chart-body {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.chart-body canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Funnel Chart */
.funnel-chart {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.funnel-stage {
    position: relative;
}

.funnel-bar {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.funnel-bar:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(241, 196, 15, 0.3);
}

.funnel-label {
    color: #000000;
    font-weight: 500;
    font-size: 0.9rem;
}

.funnel-value {
    color: #000000;
    font-weight: 700;
    font-size: 1rem;
}

/* Analytics Tables */
.analytics-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.analytics-table-container {
    background-color: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333333;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #333333;
    background-color: #1a1a1a;
}

.table-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.table-body {
    max-height: 400px;
    overflow-y: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #333333;
}

.analytics-table th {
    background-color: #333333;
    font-weight: 500;
    color: #ffffff;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.analytics-table td {
    color: #ffffff;
    font-size: 0.9rem;
    vertical-align: middle;
}

.analytics-table tbody tr {
    transition: background-color 0.15s ease;
}

.analytics-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Trend Indicators */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.trend-indicator.up {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.trend-indicator.down {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.trend-indicator.stable {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Insights Section */
.insights-section {
    margin-bottom: 2rem;
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.insights-header h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 500;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    background: linear-gradient(135deg, #1a1a1a, #333333);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #555555;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.insight-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

.insight-card.opportunity::before {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.insight-card.warning::before {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.insight-card.trend::before {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.insight-icon {
    font-size: 2rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-content h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.insight-content p {
    color: #cccccc;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.insight-action {
    margin-top: 1rem;
}

/* Goals Section */
.goals-section {
    margin-bottom: 2rem;
}

.goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.goals-header h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 500;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.goal-card {
    background: linear-gradient(135deg, #1a1a1a, #333333);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #555555;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.goal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

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

.goal-header h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.goal-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-status.achieved {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.goal-status.exceeded {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.goal-status.in-progress {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.goal-status.at-risk {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.goal-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #333333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    border-radius: 4px;
    transition: width 0.8s ease;
    position: relative;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #cccccc;
    font-size: 0.9rem;
}

.progress-percentage {
    font-weight: 600;
    color: #f1c40f;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #1a1a1a;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border: 1px solid #555555;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333333;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #888888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.15s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    background-color: #333333;
    border: 1px solid #555555;
    border-radius: 8px;
    padding: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: #f1c40f;
    box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #333333;
}

/* Export Options */
.export-options {
    margin-bottom: 1.5rem;
}

.export-format,
.export-sections {
    margin-bottom: 1.5rem;
}

.export-format h4,
.export-sections h4 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.format-options,
.section-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.format-option,
.section-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.format-option:hover,
.section-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.format-option input,
.section-option input {
    margin: 0;
}

.format-option span,
.section-option span {
    color: #ffffff;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analytics-charts-grid .chart-container.large {
        grid-column: span 12;
    }

    .analytics-charts-grid .chart-container.medium {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        overflow-x: auto;
        padding: 1rem 0;
    }

    .nav-menu {
        display: flex;
        white-space: nowrap;
        padding: 0 1rem;
        gap: 0.25rem;
    }

    .nav-item {
        flex-direction: column;
        padding: 0.5rem;
        min-width: 80px;
        text-align: center;
        border-left: none;
        border-bottom: 4px solid transparent;
    }

    .nav-item:hover,
    .nav-item.active {
        border-left: none;
        border-bottom-color: #000000;
        transform: translateY(-3px);
    }

    .nav-icon {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }

    .nav-text {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1rem;
    }

    .analytics-header {
        flex-direction: column;
        align-items: stretch;
    }

    .analytics-actions {
        justify-content: stretch;
    }

    .analytics-actions .btn,
    .analytics-actions .period-selector {
        flex: 1;
        justify-content: center;
    }

    .kpi-section {
        grid-template-columns: 1fr;
    }

    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }

    .analytics-charts-grid .chart-container {
        grid-column: span 1;
    }

    .analytics-tables {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .goals-grid {
        grid-template-columns: 1fr;
    }

    .page-title-section h1 {
        font-size: 2rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .kpi-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .kpi-icon {
        font-size: 2rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .insight-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .chart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .chart-controls {
        justify-content: stretch;
    }

    .chart-type-selector,
    .metric-selector {
        width: 100%;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .analytics-actions,
    .modal {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .chart-container,
    .kpi-card,
    .insight-card,
    .goal-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {

    .kpi-card,
    .chart-container,
    .analytics-table-container,
    .insight-card,
    .goal-card,
    .modal-content {
        border-width: 2px;
    }

    .progress-fill {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .kpi-card,
    .chart-container,
    .insight-card,
    .goal-card,
    .btn,
    .progress-fill {
        transition: none;
    }

    .kpi-card:hover,
    .chart-container:hover,
    .insight-card:hover,
    .goal-card:hover,
    .btn:hover {
        transform: none;
    }
}