/* Lighthouse Checker Public Styles - v5.1.3 
 * Final Production Version
 * Clean styling matching theme design system
 */

.lighthouse-checker {
    max-width: 600px;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* Header styles */
.lighthouse-header {
    text-align: center;
    margin-bottom: 20px;
}

.lighthouse-title {
    font-size: 24px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 4px 0;
    line-height: 1.33;
    letter-spacing: -0.02em;
}

.lighthouse-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: #667085;
    margin: 0;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* Design System Integration for hero-performance */
.hero-performance__form-inner .lighthouse-checker {
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Center the header in hero-performance */
.hero-performance__form-inner .lighthouse-header {
    text-align: left;
    margin-bottom: 20px;
}

.hero-performance__form-inner .lighthouse-title {
    font-size: 24px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 4px 0;
    line-height: 1.33;
}

.hero-performance__form-inner .lighthouse-subtitle {
    font-size: 16px;
    color: #667085;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.lighthouse-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Wide form layout for hero-performance */
.hero-performance__form-inner .lighthouse-form {
    max-width: 100%;
    width: 100%;
}

.hero-performance__form-inner .lighthouse-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .hero-performance__form-inner .lighthouse-form .form-group {
        display: grid;
        grid-template-columns: 1fr 1fr 140px;
        gap: 16px;
        align-items: end;
    }
}

/* Input fields */
.lighthouse-input {
    height: 44px;
    padding: 10px 14px;
    border: 1px solid #D0D5DD;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    color: #101828;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

.lighthouse-input::placeholder {
    color: #667085;
    font-weight: 400;
    transition: color 0.3s ease;
}

.lighthouse-input:focus {
    border-color: #B91D25;
    box-shadow: 0 0 0 3px rgba(185, 29, 37, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.lighthouse-input:focus::placeholder {
    color: #98A2B3;
}

.lighthouse-input:hover:not(:focus) {
    border-color: #98A2B3;
    box-shadow: 0 2px 4px 0 rgba(16, 24, 40, 0.08);
}

.lighthouse-input:active {
    border-color: #B91D25;
    transform: scale(0.995);
}

/* Button - Match theme's button-primary styling */
.lighthouse-button {
    height: 44px;
    padding: 10px 20px;
    background: #B91D25;
    color: white;
    border: 1px solid #B91D25;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(185, 29, 37, 0.15), 0 1px 2px 0 rgba(16, 24, 40, 0.05);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.lighthouse-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.lighthouse-button:hover {
    background-color: #A71A21;
    border-color: #A71A21;
    box-shadow: 0 6px 16px rgba(185, 29, 37, 0.2), 0 2px 4px 0 rgba(16, 24, 40, 0.1);
    transform: translateY(-1px);
}

.lighthouse-button:hover::before {
    transform: translateX(100%);
}

.lighthouse-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(185, 29, 37, 0.3), 0 1px 2px 0 rgba(16, 24, 40, 0.1);
    transition-duration: 0.1s;
}

.lighthouse-button:focus-visible {
    background-color: #B91D25;
    border-color: #B91D25;
    box-shadow: 0 0 0 3px rgba(185, 29, 37, 0.2), 0 4px 12px rgba(185, 29, 37, 0.15);
}

.lighthouse-button:disabled {
    background-color: #D0D5DD;
    border-color: #D0D5DD;
    color: #667085;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Progress indicator */
.lighthouse-progress {
    display: none;
    margin: 16px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #E5E7EB;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar::after {
    content: '';
    display: block;
    width: 30%;
    height: 100%;
    background-color: #B91D25;
    border-radius: 2px;
    animation: progress 2s infinite;
}

.progress-text {
    font-size: 14px;
    color: #6B7280;
}

/* Results */
.lighthouse-result {
    margin-top: 16px;
}

.lighthouse-result .success {
    color: #15803d;
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.lighthouse-result .error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Report result styling */
.report-result {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.report-result-text {
    font-size: 16px;
    color: #374151;
    margin-bottom: 12px;
    font-weight: 500;
}

.report-link {
    display: inline-block;
    background-color: #B91D25;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    border: 1px solid #94171E;
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
}

.report-link:hover {
    background-color: #A71A21;
    border-color: #6F1116;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px 0 rgba(16, 24, 40, 0.1);
}

.report-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(185, 29, 37, 0.1);
}

@keyframes progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* Responsive design */
@media (max-width: 991.95px) {
    .hero-performance__form-inner .lighthouse-checker {
        padding: 20px !important;
    }
}

@media (max-width: 767.95px) {
    .hero-performance__form-inner .lighthouse-checker {
        padding: 20px 16px !important;
    }
    
    /* Improve mobile form spacing */
    .hero-performance__form-inner .lighthouse-form {
        gap: 16px;
    }
    
    .hero-performance__form-inner .lighthouse-form .form-group {
        gap: 16px;
    }
    
    /* Better mobile input styling */
    .lighthouse-input {
        height: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .lighthouse-button {
        height: 48px;
        padding: 12px 20px;
        font-size: 16px;
        min-height: 48px;
    }
}

/* Medium mobile screens - iPhone 11/12/13 */
@media (max-width: 414px) {
    .hero-performance__form-inner .lighthouse-form {
        gap: 18px;
    }
    
    .lighthouse-input {
        height: 50px;
        padding: 13px 16px;
        font-size: 16px;
        border-radius: 9px;
    }
    
    .lighthouse-button {
        height: 50px;
        padding: 13px 20px;
        font-size: 16px;
        border-radius: 9px;
        min-width: 100%;
    }
}

@media (max-width: 479.95px) {
    .hero-performance__form-inner .lighthouse-checker {
        padding: 20px 16px !important;
    }
    
    /* Extra spacing for very small screens */
    .hero-performance__form-inner .lighthouse-form {
        gap: 20px;
    }
    
    .hero-performance__form-inner .lighthouse-form .form-group {
        gap: 20px;
    }
    
    /* Larger touch targets for very small screens */
    .lighthouse-input {
        height: 52px;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .lighthouse-button {
        height: 52px;
        padding: 14px 20px;
        font-size: 16px;
        min-height: 52px;
        border-radius: 10px;
        font-weight: 600;
        width: 100%;
        min-width: 100%;
    }
    
    /* Better spacing for title and subtitle on small screens */
    .hero-performance__form-inner .lighthouse-title {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .hero-performance__form-inner .lighthouse-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
        line-height: 1.4;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 375px) {
    .hero-performance__form-inner .lighthouse-checker {
        padding: 8px 4px !important;
    }
    
    .hero-performance__form-inner .lighthouse-form {
        gap: 24px;
    }
}

/* Extra wide form for all mobile screens */
@media (max-width: 768px) {
    .hero-performance .hero-performance__form-section {
        padding: 0 4px !important;
    }
    
    .hero-performance .hero-performance__form-wrapper {
        padding: 6px !important;
        margin: 0 !important;
    }
    
    .hero-performance .hero-performance__form-inner {
        padding: 8px !important;
    }
    
    .hero-performance__form-inner .lighthouse-checker {
        padding: 4px 2px !important;
    }
    
    /* Fix result container padding on mobile */
    .hero-performance__form-inner .lighthouse-result {
        margin: 16px -6px 0 -6px !important;
        padding: 0 !important;
    }
    
    .hero-performance__form-inner .lighthouse-result .success {
        margin: 0 !important;
        padding: 12px 6px !important;
    }
    
    .hero-performance__form-inner .lighthouse-result .error {
        margin: 0 !important;
        padding: 12px 6px !important;
    }
    
    .hero-performance__form-inner .inline-report-container {
        margin: 16px -6px 0 -6px !important;
        border-radius: 10px !important;
    }
    
    .hero-performance__form-inner .report-result {
        margin: 0 -6px !important;
        border-radius: 10px !important;
        padding: 16px 6px !important;
    }
    
    /* Fix inline report content on mobile */
    .hero-performance__form-inner .inline-report {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .hero-performance__form-inner .inline-report .report {
        margin: 0 !important;
        padding: 12px !important;
        border-radius: 0 !important;
    }
}

/* Ultra wide form for very small screens */
@media (max-width: 480px) {
    .hero-performance .hero-performance__form-section {
        padding: 0 2px !important;
    }
    
    .hero-performance .hero-performance__form-wrapper {
        padding: 4px !important;
        margin: 0 !important;
        border-radius: 12px !important;
    }
    
    .hero-performance .hero-performance__form-inner {
        padding: 6px !important;
        border-radius: 8px !important;
    }
    
    .hero-performance__form-inner .lighthouse-checker {
        padding: 2px 1px !important;
    }
    
    .lighthouse-input {
        border-radius: 6px !important;
        padding: 12px 8px !important;
    }
    
    .lighthouse-button {
        border-radius: 6px !important;
        padding: 12px 16px !important;
    }
    
    /* Fix result container padding on mobile */
    .hero-performance__form-inner .lighthouse-result {
        margin: 16px -4px 0 -4px !important;
        padding: 0 !important;
    }
    
    .hero-performance__form-inner .lighthouse-result .success {
        margin: 0 !important;
        padding: 12px 4px !important;
    }
    
    .hero-performance__form-inner .lighthouse-result .error {
        margin: 0 !important;
        padding: 12px 4px !important;
    }
    
    .hero-performance__form-inner .inline-report-container {
        margin: 16px -4px 0 -4px !important;
        border-radius: 8px !important;
    }
    
    .hero-performance__form-inner .report-result {
        margin: 0 -4px !important;
        border-radius: 8px !important;
        padding: 16px 4px !important;
    }
    
    /* Fix inline report content on mobile */
    .hero-performance__form-inner .inline-report {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .hero-performance__form-inner .inline-report .report {
        margin: 0 !important;
        padding: 8px !important;
        border-radius: 0 !important;
    }
}

/* iPhone SE and very small screens */
@media (max-width: 375px) {
    .lighthouse-input {
        height: 54px;
        padding: 15px 16px;
        font-size: 16px;
        border-radius: 12px;
        -webkit-appearance: none; /* Remove iOS styling */
    }
    
    .lighthouse-button {
        height: 54px;
        padding: 15px 20px;
        font-size: 17px;
        border-radius: 12px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }
    
    .hero-performance__form-inner .lighthouse-title {
        font-size: 20px;
        line-height: 1.2;
        margin-bottom: 8px;
    }
    
    .hero-performance__form-inner .lighthouse-subtitle {
        font-size: 14px;
        margin-bottom: 28px;
        line-height: 1.5;
    }
    
    /* Extra wide results on very small screens */
    .hero-performance__form-inner .lighthouse-result {
        margin: 16px -6px 0 -6px !important;
        padding: 0 !important;
    }
    
    .hero-performance__form-inner .lighthouse-result .success {
        margin: 0 !important;
        padding: 12px 6px !important;
    }
    
    .hero-performance__form-inner .lighthouse-result .error {
        margin: 0 !important;
        padding: 12px 6px !important;
    }
    
    .hero-performance__form-inner .inline-report-container {
        margin: 16px -6px 0 -6px !important;
        border-radius: 6px !important;
    }
    
    .hero-performance__form-inner .report-result {
        margin: 0 -6px !important;
        border-radius: 6px !important;
        padding: 12px 6px !important;
    }
    
    /* Fix inline report content on very small screens */
    .hero-performance__form-inner .inline-report {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .hero-performance__form-inner .inline-report .report {
        margin: 0 !important;
        padding: 6px !important;
        border-radius: 0 !important;
    }
}

/* Landscape orientation optimization */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero-performance__form-inner .lighthouse-form {
        gap: 12px;
    }
    
    .lighthouse-input {
        height: 42px;
        padding: 10px 14px;
    }
    
    .lighthouse-button {
        height: 42px;
        padding: 10px 20px;
    }
    
    .hero-performance__form-inner .lighthouse-title {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .hero-performance__form-inner .lighthouse-subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }
}

/* Inline Report Styles */
.inline-report-container {
    margin-top: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Wide report layout for hero-performance */
.hero-performance__form-inner .inline-report-container {
    max-width: none;
    margin: 24px 0 0 0;
}

/* Ensure results maintain same width as form */
.hero-performance__form-inner .lighthouse-result {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.hero-performance__form-inner .lighthouse-result .success,
.hero-performance__form-inner .lighthouse-result .error {
    box-sizing: border-box !important;
}

.hero-performance__form-inner .report-result {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure inline report content uses full width */
.hero-performance__form-inner .inline-report {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hero-performance__form-inner .inline-report .report {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.inline-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.inline-report-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.report-link-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #B91D25;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.report-link-small:hover {
    background-color: #fef2f2;
    text-decoration: none;
}

.inline-report-content {
    padding: 0;
}

/* Inline report specific styles */
.inline-report {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.inline-report .report-header {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.inline-report .metrics-container {
    padding: 16px 20px;
    background: white;
}

.inline-report .metric-item {
    margin-bottom: 20px;
    border-radius: 8px;
}

.inline-report .metric-content {
    padding: 16px;
}

.inline-report .metric-tip {
    padding: 12px 16px;
}

.inline-report .detail-report-section {
    display: none; /* Hide the detail report button in inline view */
}

/* Sticky button behavior on mobile */
@media (max-width: 767.95px) {
    .lighthouse-form {
        position: relative;
    }
    
    .lighthouse-button.sticky {
        position: sticky;
        bottom: 20px;
        z-index: 100;
        box-shadow: 0 8px 24px rgba(185, 29, 37, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
        animation: pulseGlow 2s ease-in-out infinite alternate;
    }
    
    @keyframes pulseGlow {
        0% {
            box-shadow: 0 8px 24px rgba(185, 29, 37, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        100% {
            box-shadow: 0 12px 32px rgba(185, 29, 37, 0.35), 0 6px 16px rgba(0, 0, 0, 0.2);
        }
    }
}

/* Enhanced inline report mobile styles */
@media (max-width: 768px) {
    .inline-report .metric-content {
        padding: 12px;
        flex-direction: column;
        gap: 12px;
    }
    
    .inline-report .metric-item {
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border-radius: 12px;
        overflow: hidden;
    }
    
    .inline-report .metric-rating {
        order: 2;
        align-self: center;
    }
    
    .inline-report .text-and-supporting {
        order: 1;
        text-align: center;
    }
    
    .inline-report .metric-tip {
        padding: 16px;
        border-radius: 0 0 12px 12px;
    }
    
    .inline-report-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .inline-report-header h3 {
        font-size: 16px;
    }
    
    .report-link-small {
        font-size: 13px;
        padding: 6px 12px;
        border-radius: 6px;
        background-color: rgba(185, 29, 37, 0.1);
    }
}

/* Tablet improvements */
@media (min-width: 768px) and (max-width: 991.95px) {
    .inline-report .metric-content {
        padding: 14px;
        gap: 14px;
    }
    
    .inline-report .metric-item {
        margin-bottom: 18px;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    }
}

