/* Custom styles for IDA application */

:root {
    --ida-primary: #28589f;
    --ida-secondary: #6c757d;
    --ida-success: #198754;
    --ida-info: #0dcaf0;
    --ida-warning: #ffc107;
    --ida-danger: #dc3545;
    --ida-dark: #212529;
}

/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Navigation improvements */
.navbar-brand {
    font-size: 1rem;
    font-weight: 700;
}

.navbar-brand small {
    font-size: 0.8rem;
    font-weight: 400;
}

/* Card enhancements */
.card {
    border: none;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgb(43, 33, 33, 0.15) !important;
}

.card-header {
    border-bottom: 2px solid rgb(37, 30, 30, 0.1);
}

/* Form improvements */
.form-control:focus,
.form-select:focus {
    border-color: var(--ida-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Button styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Report content styling */
.report-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.report-content h2,
.report-content h3,
.report-content h4 {
    color: var(--bs-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(13, 110, 253, 0.1);
    padding-bottom: 0.5rem;
}

.report-content h2 {
    font-size: 1.8rem;
}

.report-content h3 {
    font-size: 1rem;
}

.report-content h4 {
    font-size: 1rem;
}

.report-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.report-content ul,
.report-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.report-content li {
    margin-bottom: 0.5rem;
}

.report-content strong {
    color: var(--bs-info);
    font-weight: 600;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.connected {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--ida-success);
}

.status-indicator.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--ida-warning);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #050505 !important;
    }
    
    .report-content {
        font-size: 12pt;
        line-height: 1.4;
        color: #000 !important;
    }
    
    .report-content h2,
    .report-content h3,
    .report-content h4 {
        color: #000 !important;
        page-break-after: avoid;
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .col-md-6,
    .col-md-4 {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .row {
        margin-left: -0.375rem;
        margin-right: -0.375rem;
    }

    .row > * {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }

    form .mb-4 {
        margin-bottom: 1.25rem !important;
    }

    .form-label {
        font-size: 0.95rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        padding: 0.75rem;
    }

    textarea.form-control {
        min-height: 80px;
    }

    .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.5rem !important;
    }

    .text-center h1,
    .text-center h2,
    .text-center h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .lead {
        font-size: 1rem;
    }

    .display-4 {
        word-wrap: break-word;
    }

    .card-header {
        padding: 1rem 0.75rem !important;
    }

    .card-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .row > * {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .col-lg-8,
    .col-lg-10,
    .col-md-8 {
        width: 100% !important;
    }

    .mx-auto {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .display-4 {
        font-size: 1.5rem;
    }

    .display-6 {
        font-size: 1.2rem;
    }

    .lead {
        font-size: 0.95rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .navbar-brand {
        font-size: 0.85rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .small,
    .text-muted {
        font-size: 0.8rem;
    }

    h1, h2, h3, h4, h5, h6 {
        word-break: break-word;
    }

    .alert {
        flex-direction: column;
        gap: 0.5rem;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }

    .card-body {
        padding: 1rem 0.75rem;
    }
}

/* Animation for report generation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.generating {
    animation: pulse 1.5s ease-in-out infinite;
}

/* List group improvements */
.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Badge improvements */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}

/* Expandable sections styling */
.expandable-item {
    margin-bottom: 0.5rem;
}

.expandable-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    user-select: none;
}

.expandable-trigger:hover {
    opacity: 0.8;
}

.expandable-trigger .expand-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.8em;
    color: var(--bs-info);
}

.expandable-trigger.expanded .expand-icon {
    transform: rotate(90deg);
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    padding-left: 1.5rem;
    margin-top: 0;
}

.expandable-content.expanded {
    max-height: 2000px;
    opacity: 1;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
}

.expandable-content-inner {
    background: rgba(13, 202, 240, 0.05);
    border-left: 3px solid var(--bs-info);
    padding: 1rem 1.25rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.expandable-content-inner p {
    margin-bottom: 0.75rem;
}

.expandable-content-inner p:last-child {
    margin-bottom: 0;
}

.expandable-content-inner strong {
    color: var(--bs-info);
}

.expandable-content-inner ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

.expandable-content-inner li {
    margin-bottom: 0.25rem;
}

@media print {
    .expandable-content {
        max-height: none !important;
        opacity: 1 !important;
        padding-top: 0.5rem !important;
    }
    
    .expand-icon {
        display: none !important;
    }
}
