/**
 * Inline Trust Theater Styles
 * Enterprise-grade inline loading experience for AI audit results
 * Mobile-first, accessible, professional design
 * 
 * @version 2.0.0
 * @package AISearchRankings
 */

/* ========================================
   INLINE THEATER CONTAINER
   ======================================== */

.inline-trust-theater {
    width: 100%;
    max-width: 1290px;
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-theater-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
    border: 2px solid #005D5D;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 93, 93, 0.12), 
                0 2px 8px rgba(0, 93, 93, 0.08);
    overflow: hidden;
    position: relative;
}

.inline-theater-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #005D5D 0%, 
        #458B2F 50%, 
        #005D5D 100%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   CONTENT WRAPPER - TWO COLUMN LAYOUT
   ======================================== */

.theater-content-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding: 2rem;
    align-items: center;
}

/* ========================================
   LEFT: VISUAL PROGRESS SECTION
   ======================================== */

.theater-visual-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.theater-spinner-container {
    margin-bottom: 1rem;
}

.theater-spinner-container .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25rem;
    color: #005D5D;
}

.theater-progress-display {
    position: relative;
}

.theater-progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.theater-percent-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.percent-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #005D5D;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.percent-symbol {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #458B2F;
    margin-top: 0.125rem;
}

/* ========================================
   RIGHT: INFO SECTION
   ======================================== */

.theater-info-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.theater-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.theater-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #005D5D;
    margin: 0;
    display: flex;
    align-items: center;
}

.theater-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #005D5D 0%, #458B2F 100%);
    color: white;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theater-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========================================
   MESSAGE CONTAINER
   ======================================== */

.theater-message-container {
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.theater-message {
    font-size: 1.125rem;
    color: #1f2937;
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
    transition: opacity 0.15s ease;
}

/* ========================================
   METRICS GRID
   ======================================== */

.theater-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.theater-metric {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(0, 93, 93, 0.03);
    border: 1px solid rgba(0, 93, 93, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.theater-metric:hover {
    background: rgba(0, 93, 93, 0.05);
    border-color: rgba(0, 93, 93, 0.2);
    transform: translateY(-1px);
}

.metric-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #005D5D 0%, #458B2F 100%);
    color: white;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 1rem;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.metric-label {
    font-size: 0.6875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-size: 0.9375rem;
    color: #005D5D;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   LINEAR PROGRESS BAR
   ======================================== */

.theater-progress-bar-container {
    width: 100%;
}

.theater-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.theater-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #005D5D 0%, #458B2F 100%);
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theater-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   FOOTER
   ======================================== */

.theater-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 93, 93, 0.1);
}

.theater-footer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

/* ========================================
   COMPLETION STATE
   ======================================== */

.inline-trust-theater.completed .inline-theater-card {
    border-color: #10b981;
}

.inline-trust-theater.completed .inline-theater-card::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    animation: none;
}

.inline-trust-theater.completed .theater-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.inline-trust-theater.completed .theater-badge::before {
    animation: none;
}

/* ========================================
   FADE OUT ANIMATION
   ======================================== */

.inline-trust-theater.fade-out {
    animation: fadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ========================================
   TABLET RESPONSIVE (768px and below)
   ======================================== */

@media (max-width: 768px) {
    .theater-content-wrapper {
        grid-template-columns: 140px 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .theater-progress-ring {
        width: 100px;
        height: 100px;
    }
    
    .theater-progress-ring svg {
        width: 100px;
        height: 100px;
    }
    
    .percent-number {
        font-size: 1.5rem;
    }
    
    .theater-title {
        font-size: 1.25rem;
    }
    
    .theater-message {
        font-size: 1rem;
    }
    
    .theater-metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .metric-icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
}

/* ========================================
   MOBILE RESPONSIVE (480px and below)
   ======================================== */

@media (max-width: 480px) {
    .inline-trust-theater {
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .theater-content-wrapper {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    
    .theater-visual-section {
        padding: 0;
    }
    
    .theater-spinner-container .spinner-border {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .theater-progress-ring {
        width: 90px;
        height: 90px;
    }
    
    .theater-progress-ring svg {
        width: 90px;
        height: 90px;
    }
    
    .percent-number {
        font-size: 1.375rem;
    }
    
    .percent-symbol {
        font-size: 0.75rem;
    }
    
    .theater-title {
        font-size: 1.125rem;
    }
    
    .theater-title i {
        font-size: 1rem;
    }
    
    .theater-badge {
        font-size: 0.75rem;
        padding: 0.3125rem 0.75rem;
    }
    
    .theater-message {
        font-size: 0.9375rem;
    }
    
    .theater-message-container {
        min-height: 2.5rem;
    }
    
    .metric-label {
        font-size: 0.625rem;
    }
    
    .metric-value {
        font-size: 1.3rem;
    }
    
    .theater-footer-text {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
    .inline-theater-card {
        border-width: 3px;
        border-color: #003d3d;
    }
    
    .theater-title,
    .percent-number,
    .metric-value {
        color: #003d3d;
    }
    
    .theater-metric {
        border-width: 2px;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .inline-trust-theater,
    .theater-message,
    .theater-progress-fill,
    .theater-metric {
        animation: none !important;
        transition: none !important;
    }
    
    .inline-theater-card::before,
    .theater-badge::before,
    .theater-progress-fill::after {
        animation: none !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .inline-trust-theater {
        display: none !important;
    }
}

/* ========================================
   FOCUS STYLES FOR ACCESSIBILITY
   ======================================== */

.inline-trust-theater:focus-within {
    outline: 3px solid #458B2F;
    outline-offset: 4px;
    border-radius: 20px;
}
