/* AI Check My Site - Main Stylesheet */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #FFFFFF;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.main-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
    flex-shrink: 0;
    padding: 0 20px;
}

.header {
    color: #000;
    text-align: center;
    font-size: clamp(36px, 8vw, 60px);
    font-weight: 500;
    line-height: 1.1;
}

.header .gradient-text {
    background: linear-gradient(86deg, #90F 5.79%, #006AFF 110.2%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.url-input {
    padding: 20px 32px;
    border-radius: 80px;
    border: 1px solid #EFEFEF;
    background: #FFF;
    box-shadow: 0 0 41.999px 0 rgba(20, 20, 20, 0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #000;
    font-size: 16px;
    font-weight: 400;
    outline: none;
    width: 100%;
}

.url-input::placeholder {
    color: #000;
    opacity: 0.3;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.url-input.error {
    border-color: rgba(239, 68, 68, 0.5);
    outline: 2px solid rgba(239, 68, 68, 0.5);
    outline-offset: -1px;
}

.url-input.error::placeholder {
    color: rgba(239, 68, 68, 0.8);
    opacity: 1;
}

.action-button {
    display: flex;
    padding: 20px 32px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 40px;
    border: 1px solid #EFEFEF;
    background: #141414;
    box-shadow: 0 0 41.999px 0 rgba(20, 20, 20, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    color: #FFF;
    font-size: 16px;
    font-weight: 400;
    width: 200px;
    min-height: 48px;
}

.action-button.gradient {
    background: linear-gradient(86deg, #90F 5.79%, #006AFF 110.2%);
    border: 1px solid transparent;
}

.action-button:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: #EFEFEF;
}

.action-button.gradient:hover:not(:disabled) {
    background: linear-gradient(86deg, #90F 5.79%, #006AFF 110.2%);
    opacity: 0.9;
    border-color: transparent;
}

.action-button:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.action-button.gradient:disabled {
    background: #ccc;
    opacity: 0.5;
}

/* Essential utility classes */
.d-none { 
    display: none !important; 
}

.visually-hidden { 
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Spinner styles - Modern gradient spinner */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%, transparent 0deg, #667eea 90deg, #764ba2 180deg, transparent 360deg);
    animation: spinner-border 0.75s linear infinite;
    position: relative;
}

.spinner-border::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: white;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Modal styles - Modern glass morphism design */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 1000px;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 0;
}

.modal-overlay.active .modal-card {
    transform: translateX(0);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #111827;
}


.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.modal-loading .spinner-border {
    margin-bottom: 24px;
    width: 56px;
    height: 56px;
}

.modal-loading .spinner-border::before {
    inset: 4px;
}

.modal-loading-text {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
    letter-spacing: -0.01em;
    height: 24px;
    width: 300px;
    overflow: hidden;
    position: relative;
}

.loading-text-animated {
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
    top: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Results UI Styles - Modern & Clean */
.no-errors {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    margin: 20px 0;
}

.no-errors-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.no-errors-title {
    font-family: Inter, sans-serif;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.no-errors-text {
    font-family: Inter, sans-serif;
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
}

.error-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.error-correction {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.incorrect {
    color: #dc2626;
    font-family: Inter, sans-serif;
    font-size: 16px;
    text-decoration: line-through;
}

.arrow {
    color: #9ca3af;
    font-size: 16px;
}

.correct {
    color: #111827;
    font-weight: 500;
    font-family: Inter, sans-serif;
    font-size: 16px;
}

.error-context {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 4px;
    border-left: 3px solid #e5e7eb;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: 20px;
    margin: 20px 0;
}

.error-title {
    font-family: Inter, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.error-message {
    font-family: Inter, sans-serif;
    font-size: 16px;
    color: #7f1d1d;
    font-weight: 500;
}

/* Footer styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    pointer-events: none;
    z-index: 10;
}

.footer-left,
.footer-right {
    pointer-events: auto;
}

.copyright,
.made-by {
    font-size: 14px;
    color: #9ca3af;
}

.made-by {
    text-decoration: none;
    transition: color 0.2s ease;
}

.made-by:hover {
    color: #6b7280;
}

/* Logo styles */
.logo-container {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 10;
}

.logo {
    height: 28px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 1;
}

/* Navigation styles */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 30px;
    z-index: 10;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #111827;
}

/* Streaming Modal Styles */
.modal-card, 
.modal-card * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.results-title-section {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-bottom: 1px solid #EFEFEF;
    flex: 0 0 auto;
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    letter-spacing: -0.02em;
}

.analysis-overview-section {
    padding: 32px 0;
    background: #fafbfc;
    flex: 0 0 auto;
}

.overview-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0;
    margin-bottom: 20px;
}

.overview-status {
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
    min-height: 24px;
    transition: opacity 0.3s ease;
}

.overview-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 0;
    margin: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.page-results-section {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

.accordion-container {
    display: flex;
    flex-direction: column;
}

.accordion-item {
    /* No spacing between items */
}

.accordion-header {
    display: flex;
    width: 100%;
    padding: 24px 0;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #EFEFEF;
    cursor: pointer;
    background: white;
    transition: background-color 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #f9fafb;
}

.accordion-header.active {
    background: #f3f4f6;
}

.accordion-slug {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.accordion-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    color: #6b7280;
}


.accordion-content {
    display: none;
    padding: 0 0 24px 0;
    background: white;
}

.accordion-content.active {
    display: block;
}

.accordion-corrections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.correction-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.correction-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.correction-error {
    color: #dc2626;
    text-decoration: line-through;
    font-weight: 500;
}

.correction-arrow {
    color: #9ca3af;
    font-size: 16px;
}

.correction-fix {
    color: #059669;
    font-weight: 600;
}

.correction-context {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #d1d5db;
}

.correction-explanation {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-badge {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.no-errors-badge {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.errors-count-red {
    color: #ef4444;
    font-weight: 500;
}

.errors-count-green {
    color: #10b981;
    font-weight: 500;
}

.no-errors-message {
    text-align: center;
    padding: 32px 0;
    color: #6b7280;
    font-style: italic;
    font-size: 16px;
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .main-container {
        max-width: 800px;
        gap: 32px;
        padding: 0 24px;
    }
    
    .modal-card {
        width: 80%;
        max-width: none;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .main-container {
        max-width: 100%;
        gap: 24px;
        padding: 0 20px;
    }
    
    .header {
        font-size: clamp(28px, 6vw, 48px);
        line-height: 1.2;
    }
    
    .url-input {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .action-button {
        padding: 16px 28px;
        width: 180px;
    }
    
    .button-row {
        gap: 12px;
    }
    
    .footer {
        padding: 20px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .nav {
        padding: 20px;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .modal-card {
        width: 90%;
        max-width: none;
    }
    
    .error-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .error-correction {
        width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .main-container {
        padding: 0 16px;
        gap: 20px;
        justify-content: center;
        flex-shrink: 1;
    }
    
    .header {
        font-size: clamp(24px, 7vw, 36px);
        line-height: 1.1;
    }
    
    .url-input {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .action-button {
        padding: 14px 20px;
        width: 150px;
        font-size: 15px;
    }
    
    .button-row {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }
    
    .modal-card {
        width: 100%;
        max-width: none;
    }
    
    .footer {
        padding: 20px;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    
    .footer .made-by {
        display: none;
    }
    
    .nav {
        padding: 20px;
    }
    
    .nav-links {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 13px;
    }
    
    .no-errors {
        padding: 30px 16px;
    }
    
    .no-errors-title {
        font-size: 22px;
    }
    
    .no-errors-text {
        font-size: 15px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .main-container {
        padding: 0 12px;
        gap: 16px;
    }
    
    .header {
        font-size: clamp(22px, 7vw, 32px);
    }
    
    .url-input {
        padding: 12px 16px;
    }
    
    .action-button {
        width: 130px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .button-row {
        gap: 10px;
    }
    
    .footer {
        padding: 16px;
        text-align: center;
    }
    
    .footer .made-by {
        display: none;
    }
    
    .nav {
        padding: 16px;
    }
}

/* Stack buttons only when they really don't fit */
@media (max-width: 340px) {
    .button-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-button {
        width: 100%;
        max-width: 200px;
    }
}