/* Custom CSS for KPI Analysis Dashboard */

:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 48px);
    background-color: #4e73df;
    background: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.35rem;
    transition: all 0.15s ease-in-out;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.3);
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
    color: rgba(255, 255, 255, 0.8);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.25rem;
}

.card-title {
    color: #5a5c69;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Metrics Cards */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.text-xs {
    font-size: 0.7rem !important;
}

.text-primary {
    color: #4e73df !important;
}

.text-success {
    color: #1cc88a !important;
}

.text-info {
    color: #36b9cc !important;
}

.text-warning {
    color: #f6c23e !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

/* Charts */
.chart-area {
    position: relative;
    height: 20rem;
    width: 100%;
}

.chart-pie {
    position: relative;
    height: 15rem;
    width: 100%;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
    background-color: #f8f9fc;
}

.table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-size: 0.75em;
    font-weight: 600;
}

/* Progress bars */
.progress {
    height: 0.5rem;
    border-radius: 0.35rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

.modal-title {
    color: #5a5c69;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 0.35rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Loading states */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alert notifications */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.alert-dismissible .btn-close {
    padding: 1rem 1rem;
}

/* DataTables customizations */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.35rem !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #4e73df !important;
    color: white !important;
    border-color: #4e73df !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        padding-bottom: 1rem;
    }
    
    .chart-area,
    .chart-pie {
        height: 15rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

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

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-success {
    background-color: #1cc88a;
}

.status-warning {
    background-color: #f6c23e;
}

.status-danger {
    background-color: #e74a3b;
}

.status-info {
    background-color: #36b9cc;
}

/* File upload area */
.upload-area {
    border: 2px dashed #e3e6f0;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #4e73df;
    background-color: #f8f9fc;
}

.upload-area.dragover {
    border-color: #4e73df;
    background-color: rgba(78, 115, 223, 0.1);
}

/* Analysis results styling */
.analysis-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.insight-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.35rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.recommendation-item {
    background-color: #ffffff;
    border-left: 4px solid #4e73df;
    border-radius: 0.35rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.priority-high {
    border-left-color: #e74a3b;
}

.priority-medium {
    border-left-color: #f6c23e;
}

.priority-low {
    border-left-color: #1cc88a;
}

/* Nextcloud integration */
.nextcloud-connected {
    color: #1cc88a;
}

.nextcloud-disconnected {
    color: #e74a3b;
}

/* Print styles */
@media print {
    .sidebar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .col-md-9 {
        width: 100% !important;
        max-width: 100% !important;
    }
}