/* ===================================
   CSS Reset and Base Styles
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Scheme */
    --primary-color: #4285F4;
    --primary-hover: #3367D6;
    --secondary-color: #34A853;
    --error-color: #EA4335;
    --warning-color: #FBBC04;
    --background-color: #FFFFFF;
    --text-color: #202124;
    --text-secondary: #5F6368;
    --border-color: #DADCE0;
    --hover-bg: #F1F3F4;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: Consolas, Monaco, 'Courier New', monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

body {
    font-family: var(--font-family);
    color: #202124 !important;
    background-color: #FFFFFF !important;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color-scheme: light only !important;
}

/* Force light mode on all elements */
* {
    color-scheme: light only !important;
}

/* ===================================
   Header and Navigation
   =================================== */

header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    font-size: 0.95rem;
}

.nav-links a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.nav-links a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
   Main Content Container
   =================================== */

main {
    flex: 1;
    padding: var(--spacing-lg) var(--spacing-md);
    background-color: #FFFFFF !important;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #FFFFFF !important;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

/* ===================================
   Advertisement Container
   =================================== */

.ad-container {
    margin: var(--spacing-md) auto;
    text-align: center;
    max-width: 100%;
    min-height: 50px;
    overflow: hidden;
}

.ad-placeholder {
    background-color: var(--hover-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* AdSense responsive styling */
.adsbygoogle {
    display: block;
    min-height: 50px;
    max-width: 100%;
}

/* ===================================
   File Upload Area
   =================================== */

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    background-color: var(--background-color);
    cursor: pointer;
    transition: all var(--transition-normal);
    margin: var(--spacing-lg) 0;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #F8F9FA;
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #E8F0FE;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.7;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.upload-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: var(--spacing-xs) 0;
}

/* ===================================
   Buttons
   =================================== */

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    display: block;
    margin: var(--spacing-md) auto;
    min-width: 200px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.btn-primary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--background-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    display: block;
    margin: var(--spacing-md) auto;
    min-width: 200px;
}

.btn-secondary:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.btn-secondary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
   File Info Display
   =================================== */

.file-info {
    background-color: #E8F0FE;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    text-align: center;
}

.file-info p {
    margin: var(--spacing-xs) 0;
    color: var(--text-color);
}

.file-info strong {
    font-weight: 600;
}

/* ===================================
   Transformation Panel
   =================================== */

.transformation-panel {
    background-color: #FFFFFF !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.default-transformations {
    background-color: #F8F9FA;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.row-transformations {
    background-color: #FFF4E6;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--warning-color);
}

.default-transformations ul {
    list-style: none;
    margin-top: var(--spacing-sm);
}

.default-transformations li {
    padding: var(--spacing-xs) 0;
    color: var(--secondary-color);
    font-weight: 500;
}

.field-transformations {
    margin-bottom: var(--spacing-lg);
}

.field-transformations .info-text {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-md);
}

.field-transformation-group {
    background-color: #FFFFFF !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.field-transformation-group h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.field-group {
    background-color: #FFFFFF !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.field-group h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.transformation-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.transformation-options label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-color);
}

.transformation-options label:hover {
    color: var(--primary-color);
}

.transformation-options input[type="checkbox"],
.transformation-options input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-size: 0.95rem;
    color: var(--text-color);
}

.checkbox-label:hover span {
    color: var(--primary-color);
}

/* ===================================
   Review Panel
   =================================== */

.review-panel {
    background-color: #FFFFFF !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.review-summary {
    background-color: #E8F0FE;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.review-summary p {
    margin: var(--spacing-xs) 0;
    color: var(--text-color);
}

.review-summary strong {
    font-weight: 600;
    color: var(--primary-color);
}

.review-preview {
    background-color: #F8F9FA;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    max-height: 400px;
    overflow: auto;
}

.review-preview h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
}

.review-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.review-preview th,
.review-preview td {
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: left;
    border: 1px solid var(--border-color);
}

.review-preview th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.review-preview tr:nth-child(even) {
    background-color: white;
}

.review-preview pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.review-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.review-actions button {
    margin: 0;
}

/* ===================================
   Status Messages
   =================================== */

.status-message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    font-weight: 500;
    text-align: center;
    animation: slideIn var(--transition-normal);
}

.status-message.success {
    background-color: #E6F4EA;
    border: 1px solid var(--secondary-color);
    color: #137333;
}

.status-message.error {
    background-color: #FCE8E6;
    border: 1px solid var(--error-color);
    color: #C5221F;
}

.status-message.warning {
    background-color: #FEF7E0;
    border: 1px solid var(--warning-color);
    color: #B06000;
}

.status-message.info {
    background-color: #E8F0FE;
    border: 1px solid var(--primary-color);
    color: #1967D2;
}

.status-message.loading {
    background-color: #E8F0FE;
    border: 1px solid var(--primary-color);
    color: #1967D2;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Footer
   =================================== */

footer {
    background-color: var(--hover-bg);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    margin-top: auto;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: var(--spacing-xs) 0;
}

/* ===================================
   Loading Spinner
   =================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: var(--spacing-xs);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Responsive Design - Tablet
   =================================== */

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .nav-links {
        justify-content: center;
        gap: var(--spacing-sm);
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: var(--spacing-xs);
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .upload-area {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .upload-icon {
        font-size: 3rem;
    }

    .transformation-panel {
        padding: var(--spacing-md);
    }

    .transformation-options {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .btn-primary {
        min-width: 150px;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* ===================================
   Responsive Design - Mobile
   =================================== */

@media (max-width: 480px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }

    nav {
        padding: var(--spacing-sm);
    }

    .logo {
        font-size: 1.1rem;
    }

    .nav-links {
        gap: var(--spacing-xs);
        font-size: 0.85rem;
    }

    .nav-links a {
        padding: var(--spacing-xs) 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    main {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .upload-area {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .upload-text {
        font-size: 1rem;
    }

    .upload-info {
        font-size: 0.85rem;
    }

    .ad-placeholder {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .transformation-panel {
        padding: var(--spacing-sm);
    }

    .default-transformations {
        padding: var(--spacing-sm);
    }

    .field-group {
        padding: var(--spacing-sm);
    }

    .btn-primary {
        width: 100%;
        min-width: unset;
    }

    footer {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    footer p {
        font-size: 0.85rem;
    }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }

    .upload-area {
        border-width: 4px;
    }
}

/* Dark mode disabled - always use light theme */

/* Force light theme on all elements - override browser dark mode */
html {
    color-scheme: light only !important;
    background-color: #FFFFFF !important;
}

body,
main,
.container,
.transformation-panel,
.review-panel,
.field-transformation-group,
.field-group,
.default-transformations,
.row-transformations {
    background-color: #FFFFFF !important;
    color: #202124 !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
label {
    color: #202124 !important;
}

.transformation-panel h2,
.review-panel h2,
.field-transformation-group h4 {
    color: #202124 !important;
}

/* ===================================
   Print Styles
   =================================== */

@media print {

    header,
    footer,
    .ad-container,
    .btn-primary,
    .upload-area {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    .transformation-panel {
        border: 1px solid #000;
        box-shadow: none;
    }
}