/* Style System for FixPic */

/* 1. CSS Variables & Theme Definitions */
:root {
    /* Primary Colors */
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.45);
    
    /* Secondary & Semantic */
    --secondary-color: #0ea5e9; /* Sky */
    --success-color: #10b981; /* Emerald */
    --warning-color: #f59e0b; /* Amber */
    --danger-color: #ef4444; /* Red */
    
    /* Transition */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
}

/* Dark Theme (Default) */
html.dark {
    --bg-color: #0f172a; /* Deep Slate */
    --card-bg: rgba(30, 41, 59, 0.75); /* Translucent Card */
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus-border: var(--primary-color);
    --divider-color: rgba(255, 255, 255, 0.08);
    
    --workspace-bg: #1e293b;
    --toolbar-bg: rgba(15, 23, 42, 0.85);
    
    --preset-active-bg: rgba(99, 102, 241, 0.15);
    --preset-active-border: var(--primary-color);
    
    --btn-secondary-bg: #334155;
    --btn-secondary-hover: #475569;
    
    --dropzone-bg: rgba(30, 41, 59, 0.4);
    --dropzone-hover-bg: rgba(99, 102, 241, 0.06);
    --dropzone-border: rgba(255, 255, 255, 0.15);
    
    --shadow-app: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Light Theme */
html.light {
    --bg-color: #f1f5f9; /* Soft gray-blue */
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.06);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus-border: var(--primary-color);
    --divider-color: rgba(0, 0, 0, 0.06);
    
    --workspace-bg: #e2e8f0;
    --toolbar-bg: rgba(255, 255, 255, 0.9);
    
    --preset-active-bg: rgba(99, 102, 241, 0.08);
    --preset-active-border: var(--primary-color);
    
    --btn-secondary-bg: #e2e8f0;
    --btn-secondary-hover: #cbd5e1;
    
    --dropzone-bg: rgba(255, 255, 255, 0.5);
    --dropzone-hover-bg: rgba(99, 102, 241, 0.04);
    --dropzone-border: #cbd5e1;
    
    --shadow-app: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* 2. Global Reset & Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid var(--divider-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-icon i {
    width: 24px;
    height: 24px;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-badge {
    font-size: 0.7rem;
    font-weight: 500;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.app-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Sun/Moon Theme Toggle Icon Styling */
.header-actions {
    display: flex;
    align-items: center;
}

.btn-icon {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform 0.1s ease;
}

.btn-icon:hover {
    background: var(--btn-secondary-hover);
    transform: translateY(-1px);
}

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

html.dark .sun-icon { display: block; }
html.dark .moon-icon { display: none; }
html.light .sun-icon { display: none; }
html.light .moon-icon { display: block; }

/* 3. Main Workspace Grid Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

@media (min-width: 1024px) {
    .main-layout {
        grid-template-columns: 1.2fr 0.8fr; /* Responsive 2 column */
    }
}

/* Card base */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.workspace-card {
    display: flex;
    flex-direction: column;
    min-height: 480px;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* 4. Drag & Drop Upload Zone */
.upload-dropzone {
    width: 100%;
    max-width: 540px;
    border: 2px dashed var(--dropzone-border);
    background-color: var(--dropzone-bg);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--primary-color);
    background-color: var(--dropzone-hover-bg);
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.upload-icon-wrapper i {
    width: 32px;
    height: 32px;
}

.upload-dropzone h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-input-hidden {
    display: none;
}

/* 5. Cropper Editor Container & Overlay */
.editor-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.cropper-container-wrapper {
    width: 100%;
    max-width: 100%;
    height: 380px;
    background-color: var(--workspace-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--card-border);
}

/* Cropper Image sizing to fit container */
.cropper-container-wrapper img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* custom head guide overlay for passport */
.passport-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

/* When appended inside .cropper-crop-box for exact tracking */
.cropper-crop-box .passport-custom-guide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border: 1.5px dashed var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
}

.cropper-crop-box .passport-custom-guide::before {
    content: '';
    position: absolute;
    /* Head oval shape: 75% height, centered */
    width: 68%;
    height: 75%;
    top: 8%; /* Leave room for crown space */
    border: 2px dashed var(--warning-color);
    border-radius: 50% 50% 45% 45%; /* Slightly flatter chin */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
    background: transparent;
}

/* Horizontal eye level indicator */
.cropper-crop-box .passport-custom-guide::after {
    content: '눈 높이 가이드';
    font-size: 7px;
    color: var(--warning-color);
    font-weight: 500;
    text-align: center;
    padding-bottom: 2px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: absolute;
    top: 40%;
    left: 10%;
    right: 10%;
    height: 1px;
    border-top: 1px dotted rgba(245, 158, 11, 0.8);
}

/* Head size text markers */
.passport-guide-text {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    background-color: rgba(15, 23, 42, 0.85);
    color: var(--text-primary);
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    pointer-events: none;
}

/* Editor Toolbar controls */
.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--toolbar-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.btn-toolbar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-toolbar:hover {
    background-color: var(--btn-secondary-bg);
    color: var(--text-primary);
}

.btn-toolbar i {
    width: 18px;
    height: 18px;
}

.btn-toolbar.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

/* 6. Settings Panel Elements */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.section-title i {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.settings-card {
    margin-bottom: 16px;
}

/* Presets Grid */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.preset-item {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), transform 0.1s ease;
}

.preset-item:hover {
    border-color: var(--text-muted);
}

.preset-item.active {
    background-color: var(--preset-active-bg);
    border-color: var(--preset-active-border);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.preset-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preset-specs {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.preset-limit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.preset-item.active .preset-limit {
    color: var(--primary-color);
}

/* 7. Forms, inputs, sliders, toggles */
.form-group-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }
.mb-15 { margin-bottom: 15px; }

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Unit Inputs */
.input-unit-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-unit-wrapper input {
    width: 100%;
    padding: 10px 42px 10px 12px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-unit-wrapper input:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-unit-wrapper input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-unit {
    position: absolute;
    right: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* Size Unit Radio Toggle */
.flex-justify-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.radio-toggle-group {
    display: flex;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 2px;
    border-radius: 8px;
}

.radio-toggle-group input[type="radio"] {
    display: none;
}

.radio-toggle-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.radio-toggle-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: #ffffff;
}

.radio-toggle-group input[type="radio"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Switch styling (iOS look) */
.ios-switch {
    position: relative;
    appearance: none;
    width: 44px;
    height: 24px;
    background-color: var(--input-border);
    border-radius: 99px;
    outline: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ios-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.ios-switch:checked {
    background-color: var(--primary-color);
}

.ios-switch:checked::after {
    transform: translateX(20px);
}

.ios-switch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.divider {
    border: 0;
    height: 1px;
    background-color: var(--divider-color);
    margin: 20px 0;
}

/* Custom range slider */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: var(--input-border);
    outline: none;
    margin-top: 8px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.value-highlight {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Select & options */
.select-control {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.select-control:focus {
    border-color: var(--input-focus-border);
}

/* File comparison and results styling */
.comparison-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 14px 18px;
    gap: 15px;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.comparison-item.highlight .value {
    color: var(--success-color);
    font-weight: 700;
}

.comparison-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.comparison-item .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.comparison-item .value-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comparison-arrow {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.comparison-arrow i {
    width: 18px;
    height: 18px;
}

/* Alert dialog boxes */
.alert-box {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.4;
    align-items: flex-start;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--warning-color);
}

.alert-warning i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Actions components */
.input-button-group {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    align-items: center;
}

.input-button-group input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}

.input-suffix {
    padding-right: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    background: transparent;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--input-border);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-outline:hover {
    background-color: var(--btn-secondary-bg);
    color: var(--text-primary);
}

.btn-download {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-download:hover {
    filter: brightness(1.08);
}

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

.btn-download.btn-disabled {
    background: var(--btn-secondary-bg);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
    opacity: 0.6;
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.progress-track {
    width: 100%;
    height: 6px;
    background-color: var(--input-border);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 99px;
    transition: width 0.1s ease;
}

/* 8. Notice Card */
.notice-card {
    border: 1px solid rgba(245, 158, 11, 0.15);
    background-color: rgba(245, 158, 11, 0.03);
}

.notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--warning-color);
    margin-bottom: 12px;
}

.notice-header i {
    width: 18px;
    height: 18px;
}

.notice-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
}

.notice-list {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notice-list li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 14px;
    line-height: 1.45;
}

.notice-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--warning-color);
    font-weight: 700;
}

/* Footer Section */
.app-footer {
    text-align: center;
    padding: 32px 0 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--divider-color);
}

/* Helpers */
.hidden { display: none !important; }

/* Customize Cropper UI to match our theme */
.cropper-view-box {
    outline: 2px solid var(--primary-color);
}

.cropper-line {
    background-color: var(--primary-color);
}

.cropper-point {
    background-color: var(--primary-color);
    width: 8px;
    height: 8px;
}

.cropper-point.point-se {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.cropper-modal {
    background-color: rgba(15, 23, 42, 0.8);
}

/* 9. AdSense Sponsor Panel Styling */
.adsense-card {
    border: 1px dashed var(--card-border);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.ad-label {
    align-self: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border: 1px solid var(--divider-color);
    border-radius: 4px;
    margin-bottom: 12px;
}

.ad-placeholder {
    width: 100%;
    min-height: 250px;
    background-color: var(--input-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px dashed var(--divider-color);
    overflow: hidden;
}

.ad-fallback-text {
    position: absolute;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

/* Hide fallback text if Google AdSense successfully loads an ad */
.ad-placeholder ins[data-ad-status="filled"] ~ .ad-fallback-text,
.ad-placeholder ins:not(:empty) ~ .ad-fallback-text {
    display: none;
}

/* 10. Sidebar Tower Ads (Double sidebars) */
.sidebar-ad {
    display: none; /* Hidden on mobile/tablets */
}

@media (min-width: 1280px) {
    .sidebar-ad {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: fixed;
        top: 80px;
        width: 120px; /* Slimmer for 13-inch compatibility */
        background-color: var(--card-bg);
        border: 1px dashed var(--card-border);
        border-radius: 14px;
        padding: 8px;
        box-shadow: var(--shadow-sm);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 50;
    }

    .sidebar-ad-left {
        left: calc(50vw - 500px - 135px); /* Half of 1000px container + 120px ad width + 15px margin */
    }

    .sidebar-ad-right {
        right: calc(50vw - 500px - 135px);
    }

    .ad-placeholder-vertical {
        width: 100%;
        height: 600px; /* Standard 120x600 skyscraper height */
        background-color: var(--input-bg);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        border: 1px dashed var(--divider-color);
        overflow: hidden;
    }

    .ad-fallback-text-vertical {
        position: absolute;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        color: var(--text-muted);
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0.2em;
        pointer-events: none;
        z-index: 1;
        text-align: center;
        line-height: 1.4;
    }

    .ad-placeholder-vertical ins[data-ad-status="filled"] ~ .ad-fallback-text-vertical,
    .ad-placeholder-vertical ins:not(:empty) ~ .ad-fallback-text-vertical {
        display: none;
    }
}

/* 11. Help FAQ & Privacy Modal Styling */
.info-section {
    width: 100%;
    margin-top: 10px;
}

.info-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
}

.info-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section-title i {
    color: var(--primary-color);
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.faq-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.faq-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer Links */
.footer-links {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-muted);
    margin: 0 8px;
    font-size: 0.8rem;
    user-select: none;
}

/* Modal CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    transition: opacity var(--transition-normal);
}

.modal-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--divider-color);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-icon-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.btn-icon-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-body h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-body p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 12. Full-Width Rules and Horizontal Ad styles */
.rules-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .rules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.rules-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-item h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    border-bottom: 2px solid var(--divider-color);
    padding-bottom: 6px;
}

.rules-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.adsense-card-horizontal {
    border: 1px dashed var(--card-border);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ad-placeholder-horizontal {
    width: 100%;
    min-height: 90px;
    background-color: var(--input-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px dashed var(--divider-color);
    overflow: hidden;
}

.ad-placeholder-horizontal ins[data-ad-status="filled"] ~ .ad-fallback-text,
.ad-placeholder-horizontal ins:not(:empty) ~ .ad-fallback-text {
    display: none;
}

/* 13. Orange Warning Card Customizations */
.warning-text {
    color: var(--warning-color) !important;
}

.warning-text i {
    color: var(--warning-color) !important;
}

.rules-item h5.warning-border {
    border-bottom: 2px solid rgba(245, 158, 11, 0.25) !important;
}

/* 14. How to Use & Steps styling */
.guide-steps-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .guide-steps-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.guide-step-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-step-icon i {
    width: 18px;
    height: 18px;
}

.guide-step-content h6 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.guide-step-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.upload-steps {
    display: flex;
    gap: 15px;
    margin-top: 24px;
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px solid var(--divider-color);
    padding-top: 16px;
    width: 100%;
}

.upload-steps .step {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.upload-steps .step i {
    width: 14px;
    height: 14px;
    color: var(--success-color);
}

/* 15. Header Key Features styling */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-features {
    display: none;
    align-items: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .header-features {
        display: flex;
    }
}

.header-feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 5px 9px;
    border-radius: 7px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.header-feature-tag i {
    width: 12px;
    height: 12px;
    color: var(--primary-color);
}

.header-feature-tag:nth-child(2) {
    background-color: rgba(14, 165, 233, 0.12); /* Sky Blue */
    border-color: rgba(14, 165, 233, 0.15);
}
.header-feature-tag:nth-child(2) i {
    color: var(--secondary-color);
}

.header-feature-tag:nth-child(3) {
    background-color: rgba(245, 158, 11, 0.12); /* Amber/Warning */
    border-color: rgba(245, 158, 11, 0.15);
}
.header-feature-tag:nth-child(3) i {
    color: var(--warning-color);
}

.header-feature-tag:nth-child(4) {
    background-color: rgba(16, 185, 129, 0.12); /* Success Green */
    border-color: rgba(16, 185, 129, 0.15);
}
.header-feature-tag:nth-child(4) i {
    color: var(--success-color);
}

.header-feature-tag:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* 16. Invisible Ad Placeholders until Approval/Load */
.ad-fallback-text,
.ad-fallback-text-vertical,
.ad-label {
    display: none !important;
}

.adsense-card-horizontal,
.ad-placeholder-horizontal,
.ad-placeholder,
.sidebar-ad,
.ad-placeholder-vertical {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 17. Mobile Block Reordering */
@media (max-width: 1023px) {
    .workspace-column,
    .settings-column {
        display: contents;
    }
    
    .workspace-card {
        order: 1;
    }
    
    .presets-card {
        order: 2;
    }
    
    .details-card {
        order: 3;
    }
    
    .result-card {
        order: 4;
        margin-top: 0 !important; /* Remove desktop top margin when stacked */
    }
}




