/* ==========================================================================
   Audit Report Enhancer — Frontend Styles
   Designed for Audit.gov.kn  |  Government-neutral, accessible, clean.
   ========================================================================== */

/* ---- Shared button base ---- */
.are-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.45em 1em;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.are-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==========================================================================
   TTS Player
   ========================================================================== */
.are-tts-player {
    margin: 1.25em 0;
    padding: 1em 1.25em;
    background: #f4f6f9;
    border-left: 4px solid #1a4f8a; /* Government blue */
    border-radius: 0 6px 6px 0;
    font-family: inherit;
}

.are-tts-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.75em;
}

.are-tts-icon {
    font-size: 1.2em;
}

.are-tts-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a4f8a;
}

.are-tts-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em;
}

.are-btn-play {
    color: #1a4f8a;
    border-color: #1a4f8a;
}

.are-btn-play:hover:not(:disabled) {
    background: #1a4f8a;
    color: #fff;
}

.are-btn-stop {
    color: #b91c1c;
    border-color: #b91c1c;
}

.are-btn-stop:hover:not(:disabled) {
    background: #b91c1c;
    color: #fff;
}

.are-speed-label,
.are-voice-label {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.35em;
    color: #444;
}

.are-speed-select,
.are-voice-select {
    font-size: 0.8rem;
    padding: 0.25em 0.4em;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
}

/* Progress bar */
.are-tts-progress {
    margin-top: 0.75em;
    height: 6px;
    background: #d1d5db;
    border-radius: 3px;
    overflow: hidden;
}

.are-tts-bar {
    height: 100%;
    width: 0;
    background: #1a4f8a;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.are-tts-status {
    margin: 0.4em 0 0;
    font-size: 0.78rem;
    color: #555;
    min-height: 1.2em;
}

/* ==========================================================================
   AI Summarizer
   ========================================================================== */
.are-summarizer {
    margin: 1.5em 0;
}

.are-btn-summarize {
    color: #065f46; /* Government green */
    border-color: #065f46;
    font-size: 0.9rem;
    padding: 0.55em 1.2em;
}

.are-btn-summarize:hover:not(:disabled) {
    background: #065f46;
    color: #fff;
}

.are-summary-output {
    margin-top: 1em;
    padding: 1.25em 1.5em;
    background: #f0fdf4;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    line-height: 1.7;
}

.are-summary-heading {
    margin: 0 0 0.75em;
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
    border-bottom: 1px solid #6ee7b7;
    padding-bottom: 0.4em;
}

.are-summary-text {
    font-size: 0.92rem;
    color: #1f2937;
}

.are-summary-text h2,
.are-summary-text h3,
.are-summary-text h4 {
    margin: 1em 0 0.4em;
    color: #1a4f8a;
}

.are-summary-text p {
    margin: 0.6em 0;
}

.are-summary-text li {
    margin-left: 1.5em;
    list-style: disc;
}

.are-summary-text strong {
    color: #111;
}

.are-summary-disclaimer {
    margin: 1em 0 0;
    padding-top: 0.75em;
    border-top: 1px solid #6ee7b7;
    font-size: 0.78rem;
    color: #6b7280;
}

/* Typing cursor animation */
.are-typing-cursor {
    display: inline-block;
    animation: are-blink 0.8s step-start infinite;
    color: #065f46;
    font-weight: bold;
}

@keyframes are-blink {
    50% { opacity: 0; }
}

/* Error state */
.are-error {
    color: #b91c1c;
}

/* ==========================================================================
   Search widget
   ========================================================================== */
.are-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 1.5em 0;
}

.are-search-form {
    display: flex;
    gap: 0;
}

.are-search-input {
    flex: 1;
    padding: 0.6em 0.9em;
    font-size: 0.95rem;
    border: 2px solid #1a4f8a;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: box-shadow 0.15s;
}

.are-search-input:focus {
    box-shadow: 0 0 0 3px rgba(26, 79, 138, 0.25);
}

.are-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.6em 1.1em;
    background: #1a4f8a;
    color: #fff;
    border: 2px solid #1a4f8a;
    border-radius: 0 4px 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.are-search-btn:hover {
    background: #143d6e;
    border-color: #143d6e;
}

.are-live-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 320px;
    overflow-y: auto;
}

.are-live-result-item {
    padding: 0.65em 1em;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    font-size: 0.875rem;
}

.are-live-result-item:last-child {
    border-bottom: none;
}

.are-live-result-item:hover,
.are-live-result-item:focus {
    background: #eff6ff;
}

.are-live-result-item a {
    font-weight: 600;
    color: #1a4f8a;
    text-decoration: none;
}

.are-live-result-item .are-result-excerpt {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.2em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media ( max-width: 600px ) {
    .are-tts-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .are-search-form {
        flex-direction: column;
    }

    .are-search-input {
        border-right: 2px solid #1a4f8a;
        border-radius: 4px 4px 0 0;
    }

    .are-search-btn {
        border-radius: 0 0 4px 4px;
        justify-content: center;
    }
}
