/*
 * Clarity DX Portal - Common Styles
 * Shared CSS used across multiple templates
 */

/* ==========================================================================
   Status & Validation Styles
   ========================================================================== */

/* Charge mismatch highlighting */
.charge-mismatch {
    background-color: #f8d7da !important;
    border: 2px solid #dc3545 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
}

/* Validation row highlights */
.validation-highlight {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
}

.validation-error-highlight {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545 !important;
}

/* Status badge styling */
.status-badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* ==========================================================================
   Loading Overlay Styles
   ========================================================================== */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0E4D64;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Progress bar container */
.progress-container {
    margin: 20px 0;
}

.progress {
    height: 25px;
    border-radius: 5px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Log output container */
.log-container {
    margin-top: 20px;
    text-align: left;
}

.log-output {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    padding: 15px;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.log-output .log-entry {
    margin-bottom: 2px;
    line-height: 1.4;
}

.log-output .log-entry.info {
    color: #4fc3f7;
}

.log-output .log-entry.success {
    color: #81c784;
}

.log-output .log-entry.warning {
    color: #ffb74d;
}

.log-output .log-entry.error {
    color: #e57373;
}

/* ==========================================================================
   Card & Table Styles
   ========================================================================== */

/* Bill card improvements */
.bill-card {
    transition: box-shadow 0.2s ease;
}

.bill-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Table hover effect */
.table-hover tbody tr:hover {
    background-color: rgba(14, 77, 100, 0.05);
}

/* Clickable row styling */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: rgba(14, 77, 100, 0.1) !important;
}

/* ==========================================================================
   Form & Input Styles
   ========================================================================== */

/* Required field indicator */
.required-field::after {
    content: " *";
    color: #dc3545;
}

/* Currency input styling */
.currency-input .input-group-text {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Text truncation */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Muted link */
.muted-link {
    color: #6c757d;
    text-decoration: none;
}

.muted-link:hover {
    color: #495057;
    text-decoration: underline;
}

/* Small text helper */
.text-xs {
    font-size: 0.75rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .loading-content {
        padding: 20px;
    }

    .log-output {
        font-size: 10px;
        max-height: 150px;
    }
}
