/* ===== FONT IMPORTS ===== */
@import url('https://rsms.me/inter/inter.css');

/* ===== BASE STYLES ===== */
html { 
    font-family: 'Inter', sans-serif; 
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5faff;
    color: #052c58;
}

/* ===== GLOBAL TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: #052c58;
}

/* ===== GLOBAL BORDER RADIUS ===== */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.form-input,
.form-textarea,
.card,
.faq-accordion-item,
.text-input-container,
.results-container,
.explanations-container {
    border-radius: 12px;
}

/* ===== CUSTOM SCROLLBARS ===== */
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== TRANSITIONS & ANIMATIONS ===== */
.transition-all {
    transition: all 0.2s ease-in-out;
}

.btn-hover {
    transition: transform 0.1s ease-in-out;
}

.btn-hover:hover {
    transform: translateY(-1px);
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===== FOCUS & ACCESSIBILITY ===== */
.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(5, 44, 88, 0.5);
}

/* High contrast focus for better accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #052c58;
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    background: #052c58;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-weight: 600;
    font-size: 14px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 6px;
}

/* ===== TEXT SELECTION ===== */
::selection {
    background-color: #052c58;
    color: white;
}

::-moz-selection {
    background-color: #052c58;
    color: white;
}

/* ===== UTILITY CLASSES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== DARK MODE SUPPORT (Future Enhancement) ===== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
    /* This is prepared for future dark mode implementation */
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-white {
        background: white !important;
        border: 1px solid #ccc !important;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #f9fafb !important;
    }
    
    .border-gray-200 {
        border-color: #374151 !important;
    }
    
    .text-gray-600 {
        color: #374151 !important;
    }
    
    .text-gray-500 {
        color: #4b5563 !important;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Hardware acceleration for animations */
.transform {
    will-change: transform;
}

/* Optimize paint operations */
.bg-white,
.bg-gray-50,
.bg-blue-50 {
    will-change: auto;
}

/* ===== LANGUAGE SWITCHER STYLES ===== */
.language-switcher-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
}

@media (max-width: 768px) {
    .language-switcher-container {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        text-align: center;
        z-index: 1001;
    }
}

/* ===== BUTTON STYLES WITH IMPROVED CONTRAST ===== */
.btn-primary {
    background: linear-gradient(135deg, #052c58 0%, #0f4c75 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(5, 44, 88, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f4c75 0%, #1a5f8a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 44, 88, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus {
    outline: 2px solid #052c58;
    outline-offset: 2px;
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #d1d5db;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary:focus {
    outline: 2px solid #6b7280;
    outline-offset: 2px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-danger:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-success:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* ===== FORM STYLES WITH IMPROVED CONTRAST ===== */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    color: #1f2937;
    background: white;
    transition: all 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #052c58;
    box-shadow: 0 0 0 3px rgba(5, 44, 88, 0.1);
}

.form-textarea {
    width: 100%;
    height: 120px;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    color: #1f2937;
    background: white;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease-in-out;
}

.form-textarea:focus {
    outline: none;
    border-color: #052c58;
    box-shadow: 0 0 0 3px rgba(5, 44, 88, 0.1);
}

/* ===== CARD STYLES ===== */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

@media (min-width: 768px) {
    .card {
        padding: 32px;
    }
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

/* ===== TABLE STYLES WITH IMPROVED ACCESSIBILITY ===== */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table-header {
    background: #f9fafb;
}

.table-cell {
    vertical-align: middle;
}

.table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.table tbody tr:hover {
    background: #f3f4f6;
}

/* ===== STATUS INDICATORS ===== */
.status-success {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== LOGO STYLES ===== */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.combined-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    animation: logoFadeIn 0.6s ease-out;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

.combined-logo:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.logo-icon {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
}

.logo-icon:hover {
    transform: scale(1.1);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #052c58;
}

@media (max-width: 768px) {
    .logo-container {
        margin-bottom: 1.5rem;
    }
    
    .combined-logo {
        gap: 8px;
        padding: 10px 16px;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .logo-text {
        font-size: 20px;
    }
}

@media (min-width: 1024px) {
    .logo-container {
        margin-bottom: 3rem;
    }
    
    .combined-logo {
        gap: 16px;
        padding: 16px 24px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .logo-text {
        font-size: 28px;
    }
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-contrast: high) {
    .logo-icon {
        filter: contrast(1.2);
    }
    
    .combined-logo {
        border: 2px solid #052c58;
        padding: 8px 12px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 1);
    }
}

/* ===== FAQ ACCORDION STYLES WITH IMPROVED ACCESSIBILITY ===== */
.faq-accordion {
    width: 100%;
}

.faq-accordion-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-accordion-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-accordion-button {
    width: 100%;
    padding: 20px 24px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    transition: all 0.2s ease;
}

.faq-accordion-button:hover {
    background: #f9fafb;
}

.faq-accordion-button:focus {
    outline: 2px solid #3399ff;
    outline-offset: -2px;
}

.faq-accordion-button:focus:not(:focus-visible) {
    outline: none;
}

.faq-accordion-question {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
}

.faq-accordion-icon {
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform 0.3s ease;
    color: #6b7280;
}

.faq-accordion-icon.rotated {
    transform: rotate(180deg);
}

.faq-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9fafb;
}

.faq-accordion-content-inner {
    padding: 20px 24px;
    max-width: none;
    width: 100%;
}

.faq-accordion-answer {
    padding: 20px 0;
    color: #374151;
    line-height: 1.6;
}

.faq-accordion-button:focus-visible {
    outline: 2px solid #3399ff;
    outline-offset: -2px;
}

.faq-accordion-content {
    border-top: 1px solid #e5e7eb;
}

.faq-accordion-content.open {
    max-height: 500px;
}

@media (max-width: 768px) {
    .faq-accordion-button {
        padding: 16px 20px;
    }
    
    .faq-accordion-question {
        font-size: 15px;
    }
    
    .faq-accordion-content-inner {
        padding: 0 20px;
    }
    
    .faq-accordion-icon {
        margin-left: 12px;
    }
}

@media (prefers-contrast: high) {
    .faq-accordion-item {
        border-width: 2px;
    }
    
    .faq-accordion-button:hover {
        background: #e5e7eb;
    }
    
    .faq-accordion-content {
        background: #f3f4f6;
    }
}

@media (prefers-reduced-motion: reduce) {
    .faq-accordion-button,
    .faq-accordion-icon,
    .faq-accordion-content {
        transition: none;
    }
}

/* ===== BADGE STYLES ===== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.marker-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f3f4f6;
    color: #374151;
    position: relative;
}

.marker-badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ===== CONTAINER STYLES ===== */
.text-input-container {
    margin: 0 0 1rem 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.results-container {
    margin: 0 0 2rem 0;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.explanations-container {
    margin: 0 0 2rem 0;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.faq-container {
    margin: 0 0 2rem 0;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Header content wrapper for title and description */
.header-content {
    margin: 0 0 2rem 0;
    text-align: center;
}

.footer {
    margin: 0;
    padding: 24px;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}

.footer a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #1f2937;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .text-input-container,
    .results-container,
    .explanations-container,
    .faq-container,
    .header-content {
        margin: 0 0 1rem 0;
        padding: 16px;
    }
    
    .footer {
        margin: 0;
        padding: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .text-input-container,
    .results-container,
    .explanations-container,
    .faq-container {
        margin: 0 0 1rem 0;
        padding: 20px;
    }
    
    .footer {
        margin: 0;
        padding: 24px;
    }
}

/* ===== TEXT UTILITIES ===== */
.text-red-600 {
    color: #dc2626;
}

.hover\:text-red-800:hover {
    color: #991b1b;
}

.focus\:ring-red-500:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5);
}

/* ===== CLEANED TEXT SECTION ===== */
.cleaned-text-section {
    margin-top: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cleaned-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: white;
    resize: vertical;
}

.cleaned-textarea:focus {
    outline: none;
    border-color: #3399ff;
    box-shadow: 0 0 0 3px rgba(51, 153, 255, 0.1);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESULTS STYLES ===== */
.results-container {
    animation: fadeInUp 0.5s ease-out;
}

.markers-count {
    animation: countUp 0.3s ease-out;
}

.marker-badge:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.marker-badge:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: 4px;
    z-index: 1000;
}

/* ===== NEW LAYOUT STRUCTURE ===== */
/* Main container with sidebar for ads */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Full width header section */
.header-section {
    width: 100%;
    margin-bottom: 32px;
}

/* Content area with three columns: content, ads1, ads2 */
.content-layout {
    display: flex;
    gap: 24px;
    margin-top: 32px;
}

.content-main {
    flex: 2; /* Main content takes more space */
    min-width: 0; /* Prevents flex item from overflowing */
}

.ads-column-1 {
    flex-shrink: 0;
    width: 160px;
}

.ads-column-2 {
    flex-shrink: 0;
    width: 160px;
}

/* 2-column header layout */
.header-two-column {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

/* AdSense placeholder boxes */
.adsense-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 24px;
    width: 728px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.adsense-placeholder-sidebar {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 24px;
    width: 160px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 24px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .content-layout {
        flex-direction: column;
    }
    
    .ads-column-1,
    .ads-column-2 {
        display: none; /* Hide ad columns on smaller screens */
    }
    
    .header-two-column {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }
    
    .header-left {
        justify-content: center;
    }
    
    .header-right {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 0 12px;
    }
    
    .content-layout {
        gap: 16px;
    }
    
    .header-two-column {
        gap: 12px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 12px;
    }
    
    .adsense-placeholder {
        width: 100%;
        max-width: 320px;
        height: 50px;
        padding: 16px;
    }
    
    .adsense-placeholder-sidebar {
        width: 100%;
        max-width: 160px;
        height: 400px;
        padding: 12px;
        position: static;
        margin: 0 auto;
    }
    
    .ads-column-1,
    .ads-column-2 {
        display: none; /* Ensure ad columns are hidden on mobile */
    }
} 