/*
 * O.Translator Tools - Base Styles (V13 - Theme-Aware)
 * ---------------------------------------------------------
 */

/* 1. Global Styles (Light Theme Default) */
:root {
    --action-bar-height: 120px;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #F9FAFB; /* gray-50 */
    font-family: 'Inter', sans-serif;
    color: #1F2937; /* gray-800 */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 2. Content Section Components (Light Theme) */
.content-section {
    max-width: 64rem; /* 1024px */
    margin-left: auto;
    margin-right: auto;
    margin-top: 4rem; /* 64px */
    background-color: #ffffff;
    border: 1px solid #E5E7EB; /* gray-200 */
    border-radius: 1rem; /* 16px */
    padding: 2.5rem; /* 40px */
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.section-title {
    font-size: 2.25rem; /* 36px */
    line-height: 2.5rem; /* 40px */
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem; /* 48px */
}

.feature-card { /* For "How to Use" */
    background-color: #F9FAFB; /* gray-50 */
    border: 1px solid #E5E7EB; /* gray-200 */
    border-radius: 0.75rem; /* 12px */
    padding: 1.5rem; /* 24px */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4rem; /* 64px */
    width: 4rem; /* 64px */
    border-radius: 9999px;
    background-color: #DBEAFE; /* blue-100 */
    color: #1E40AF; /* blue-800 */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem; /* 24px */
    font-weight: 700;
    font-size: 1.5rem; /* 24px */
    line-height: 2rem; /* 32px */
    border: 2px solid #93C5FD; /* blue-300 */
}
.feature-title {
    font-size: 1.125rem; /* 18px */
    line-height: 1.75rem; /* 28px */
    font-weight: 600;
    margin-bottom: 0.5rem; /* 8px */
}
.feature-description {
    font-size: 0.875rem; /* 14px */
    line-height: 1.25rem; /* 20px */
    color: #4B5563; /* gray-600 */
}

.feature-highlight-card { /* For "Why Choose Us" */
    display: flex;
    align-items: flex-start;
    padding: 1.5rem; /* 24px */
}
.feature-highlight-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem; /* 48px */
    width: 3rem; /* 48px */
    border-radius: 9999px;
    background-color: #DCFCE7; /* green-100 */
    color: #166534; /* green-800 */
    border: 1px solid #86EFAC; /* green-300 */
}
.feature-highlight-title {
    font-size: 1.125rem; /* 18px */
    line-height: 1.75rem; /* 28px */
    font-weight: 700;
}
.feature-highlight-description {
    margin-top: 0.5rem; /* 8px */
    font-size: 1rem; /* 16px */
    line-height: 1.5rem; /* 24px */
    color: #4B5563; /* gray-600 */
}

.faq-item details {
    background-color: #F9FAFB; /* gray-50 */
    border: 1px solid #E5E7EB; /* gray-200 */
    border-radius: 0.5rem; /* 8px */
    margin-bottom: 1rem;
}
.faq-question {
    padding: 1rem; /* 16px */
    font-weight: 600;
    cursor: pointer;
    list-style-type: none;
    display: flex;
    justify-content: space-between;
}
.faq-answer {
    padding: 1rem; /* 16px */
    border-top: 1px solid #E5E7EB; /* gray-200 */
    color: #4B5563; /* gray-600 */
}

/*
 * Dark Theme Overrides
 * -----------------------------------------
 */
.dark body {
    background-color: #0D1117;
    color: #C9D1D9;
}

.dark .content-section {
    background: linear-gradient(145deg, rgba(22, 27, 34, 0.6), rgba(13, 17, 23, 0.4));
    border-color: #30363d;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.dark .section-title {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

.dark .feature-card {
    background-color: rgba(34, 41, 51, 0.5);
    border-color: #30363d;
}
.dark .feature-card:hover {
    box-shadow: 0 8px 25px rgba(48, 168, 255, 0.15);
    border-color: #30a8ff;
}
.dark .feature-icon {
    background-color: rgba(30, 58, 138, 0.5);
    color: #93c5fd;
    border-color: #1d4ed8;
}
.dark .feature-title { color: #ffffff; }
.dark .feature-description { color: #9ca3af; }

.dark .feature-highlight-card { background-color: transparent; }
.dark .feature-highlight-icon {
    background-color: rgba(20, 83, 45, 0.5);
    color: #4ade80;
    border-color: #15803d;
}
.dark .feature-highlight-title { color: #ffffff; }
.dark .feature-highlight-description { color: #9ca3af; }

.dark .faq-item details {
    background-color: rgba(34, 41, 51, 0.5);
    border-color: #30363d;
}
.dark .faq-question { color: #ffffff; }
.dark .faq-answer { border-color: #374151; color: #9ca3af; }

/*
 * Comic Viewer Specific Styles
 * -----------------------------------------
 */
#file-input {
    display: none;
}

#viewer-container {
    height: calc(100vh);
    overflow-y: auto;
    scroll-behavior: auto;
}

.drag-over {
    border-style: dashed;
    border-color: #3b82f6; /* Tailwind blue-500 */
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.dark .loader {
    border: 5px solid #4a5568;
    border-top: 5px solid #3b82f6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#viewer-container::-webkit-scrollbar, #history-list::-webkit-scrollbar, #bookmarks-list::-webkit-scrollbar, #enhance-panel-content::-webkit-scrollbar {
    width: 8px;
}

#viewer-container::-webkit-scrollbar-track, #history-list::-webkit-scrollbar-track, #bookmarks-list::-webkit-scrollbar-track, #enhance-panel-content::-webkit-scrollbar-track {
    background: #e5e7eb; /* gray-200 */
}

#viewer-container::-webkit-scrollbar-thumb, #history-list::-webkit-scrollbar-thumb, #bookmarks-list::-webkit-scrollbar-thumb, #enhance-panel-content::-webkit-scrollbar-thumb {
    background: #9ca3af; /* gray-400 */
    border-radius: 4px;
}

#viewer-container::-webkit-scrollbar-thumb:hover, #history-list::-webkit-scrollbar-thumb:hover, #bookmarks-list::-webkit-scrollbar-thumb:hover, #enhance-panel-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}

.dark #viewer-container::-webkit-scrollbar-track, .dark #history-list::-webkit-scrollbar-track, .dark #bookmarks-list::-webkit-scrollbar-track, .dark #enhance-panel-content::-webkit-scrollbar-track {
    background: #1f2937; /* gray-800 */
}

.dark #viewer-container::-webkit-scrollbar-thumb, .dark #history-list::-webkit-scrollbar-thumb, .dark #bookmarks-list::-webkit-scrollbar-thumb, .dark #enhance-panel-content::-webkit-scrollbar-thumb {
    background: #4b5563; /* gray-600 */
}

.dark #viewer-container::-webkit-scrollbar-thumb:hover, .dark #history-list::-webkit-scrollbar-thumb:hover, .dark #bookmarks-list::-webkit-scrollbar-thumb:hover, .dark #enhance-panel-content::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}

#reader-toolbar {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

#reader-toolbar.collapsed {
    height: 4px;
    padding: 0;
    margin-bottom: 2px;
    background-color: transparent !important;
    border: none;
    box-shadow: none;
}

#reader-toolbar.collapsed > * {
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
    visibility: hidden;
}

#reader-toolbar.collapsed .progress-container {
    opacity: 1;
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
}

#reader-toolbar.collapsed .progress-container > div {
    background-color: transparent !important;
}
