/* YourTools.Cloud - Main Stylesheet */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #0b1220; /* dark page background */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: #666;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1d4ed8;
}

/* Header Styles */
.main-header {
    background: #0f172a; /* slate-900 */
    color: #e5e7eb; /* text color for dark header */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand-only {
    justify-content: flex-start;
}

.nav-logo .logo-link,
.logo-link.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5e7eb;
}

.nav-simple {
    justify-content: center;
}

.logo-emoji {
    font-size: 1.75rem;
}

.logo-img {
    width: 32px;
    height: 32px;
}

/* Inline stacked logo */
.logo-stack {
    position: relative;
    width: 56px;
    height: 40px;
}

.logo-cloud {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 36px;
    fill: #e2e8f0; /* slate-200 */
    opacity: 0.95;
}

.logo-wrench {
    position: absolute;
    left: 8px;
    top: -2px;
    width: 44px;
    height: 44px;
    fill: #f59e0b; /* amber-500 */
}

/* Removed old header brand styling - now using hero section for branding */

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #6b7280;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Main Content */
.main-content {
    min-height: auto;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #22d3ee 0%, #6366f1 50%, #f43f5e 100%);
    color: white;
    padding: 1.5rem 0 1.25rem; /* increased height to avoid clipping */
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Floating clouds background */
.hero-clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Cloud styles will be dynamically generated from header.json */

/* Google Ad Section */
.google-ad-section {
    width: 100%;
    padding: 0;
    background: transparent;
}

.google-ad-container {
    margin: 2rem auto;
    text-align: center;
    max-width: 1200px;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.google-ad-container ins {
    display: block;
    margin: 0 auto;
}

/* Responsive ad adjustments */
@media (max-width: 768px) {
    .google-ad-container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }
}

@media (max-width: 480px) {
    .google-ad-container {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.hero-icon {
    flex-shrink: 0;
    opacity: 0.9;
}

.hero-icon svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    width: 240px;
    height: 240px;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 0;
    margin-top: 0;
    color: white;
}

.hero .subtitle { display: none; }

.hero .description { display: none; }
 
 .hero-signature {
    font-family: 'Pacifico', cursive;
    font-weight: 400;
    letter-spacing: 1px;
}

.hero-tagline {
    font-size: 1.5rem;
    font-weight: 300;
    color: white;
    margin: 0.75rem 0 0 0;
    opacity: 0.9;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: #2563eb;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background-color: #f9fafb;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background-color: #2563eb;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.5rem;
}

/* Footer Styles */
.main-footer {
    background-color: #1f2937;
    color: #9ca3af;
    padding: 1rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-three-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    min-height: 2rem;
}

.footer-left {
    flex: 0 1 auto;
    display: flex;
    justify-content: flex-start;
    min-width: 0;
}

.footer-center {
    flex: 1;
    display: flex;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 1rem;
}

.footer-right {
    flex: 0 1 auto;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.footer-copyright,
.footer-production,
.footer-links {
    color: #9ca3af;
}

/* Footer Links */
.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #2563eb; /* Accent color on hover */
}

/* Footer Images */
.footer-image {
    height: 16px;
    width: auto;
    vertical-align: middle;
    transition: filter 0.3s ease;
}

.footer-image:hover {
    filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.6)); /* Subtle blue glow on hover */
}

/* Production Company Link */
.footer-production-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-production-link:hover {
    color: #2563eb; /* Accent color on hover */
}

/* Footer Separators */
.footer-separator {
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .footer-three-section {
        font-size: 0.8rem;
        gap: 0.25rem;
    }
    
    .footer-center {
        padding: 0 0.5rem;
    }
}

@media (max-width: 768px) {
    .footer-three-section {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .footer-left,
    .footer-center,
    .footer-right {
        justify-content: center;
        flex: none;
        width: 100%;
    }
    
    .footer-center {
        white-space: normal;
        overflow: visible;
    }
    
    .footer-right {
        order: -1; /* Move webmaster/links to top on mobile */
    }
}

/* Uploader Section */
.uploader {
    padding: 1.5rem 0 0.5rem;
    background-color: #ffffff;
}

.uploader-subtitle {
    font-size: 1.375rem;
    color: #374151;
    margin: 1rem 0 2rem 0;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Format Slot Machine Effect */
.format-slot-machine {
    display: inline-flex;
    position: relative;
    height: 1.6em;
    overflow: hidden;
    vertical-align: middle;
    width: 5em;
    text-align: center;
    align-items: center;
    border-radius: 8px;
    background: white;
    color: #000;
    font-weight: 700;
    font-size: 1.1em;
    margin: 0 0.25rem;
    border: 3px solid;
    border-image: linear-gradient(45deg, #ffd700, #ffed4e, #fbbf24, #f59e0b, #ffd700) 1;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 215, 0, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.1);
    animation: golden-glow 2s ease-in-out infinite alternate;
}

.format-reel {
    display: block;
    position: relative;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.format-reel.spinning {
    transition: transform 0.1s linear;
}

.format-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.6em;
    line-height: 1.6em;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    color: #000;
    font-weight: 700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4);
    animation: text-sparkle 1.5s ease-in-out infinite alternate;
}

/* Golden sparkle animations */
@keyframes golden-glow {
    0% { 
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.4),
            inset 0 0 20px rgba(255, 215, 0, 0.1),
            0 4px 15px rgba(0, 0, 0, 0.1);
    }
    100% { 
        box-shadow: 
            0 0 30px rgba(255, 215, 0, 0.7),
            inset 0 0 30px rgba(255, 215, 0, 0.2),
            0 6px 20px rgba(0, 0, 0, 0.15);
    }
}

@keyframes text-sparkle {
    0% { 
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4);
    }
    100% { 
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 1.0),
            0 0 25px rgba(255, 215, 0, 0.8),
            0 0 35px rgba(255, 215, 0, 0.6),
            0 0 45px rgba(255, 215, 0, 0.4);
    }
}

/* Slot machine rolling keyframes for rapid spinning */
@keyframes slot-spin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

.format-reel.rapid-spin {
    animation: slot-spin 0.05s linear infinite;
}

.dropzone {
    border: 3px dashed #22d3ee;
    border-radius: 1.25rem;
    padding: 4.25rem 2rem 3rem;
    text-align: center;
    color: #0f172a;
    background: linear-gradient(180deg, #ecfeff 0%, #eef2ff 100%);
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    max-width: 900px;
    margin: 0 auto;
    overflow: visible;
}

.dropzone.highlight {
    border-color: #f43f5e;
    background: linear-gradient(180deg, #e0f2fe 0%, #fae8ff 100%);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
}

.file-input {
    display: none;
}

.dropzone-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #0f172a;
}

.dropzone-subtitle {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.dropzone-hint {
    color: #64748b;
    font-size: 0.9rem;
}

.file-list {
    margin-top: 1rem;
}

.file-list-header {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: 0.5rem;
    background: #ffffff;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.12);
}

.file-item .file-name {
    flex: 1.2;
}

.file-item .file-actions {
    flex: 0.8;
}

.file-name {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #2563eb;
}

.file-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.file-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.format-select {
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #111827;
}

.convert-btn {
    margin-left: 0.75rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    border: none;
    background: #22c55e;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.convert-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.convert-btn.queued {
    background: #64748b;
}

.convert-btn.queued.cancel {
    background: #ef4444;
}

.convert-btn.download {
    background: #2563eb;
}

.convert-btn.downloaded {
    background: #6b7280;
    color: #e5e7eb;
}
.convert-btn.downloaded:hover {
    background: #2563eb;
}

.duplicate-btn {
    margin-right: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid #86efac;
    background: #dcfce7;
    color: #15803d;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.remove-btn {
    margin-left: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 0.5rem;
    border: 2px solid #fecaca;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Convert-all bar */
.convert-all-bar {
    position: sticky;
    bottom: 0.75rem;
    max-width: 900px;
    margin: 0.75rem auto 0;
    padding: 0;
}

.convert-all-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(34,197,94,0.15));
    border: 1px solid #334155;
    border-radius: 0.75rem;
    backdrop-filter: blur(4px);
}

.convert-all-info {
    color: #e2e8f0;
    font-weight: 600;
}

.convert-all-btn {
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    border: none;
    background: #10b981;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.dropzone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 1rem 0;
    color: #6366f1;
}
.dropzone-icon svg {
    width: 80px;
    height: 80px;
    display: block;
}

/* Capability banner */
.capability-banner {
    position: sticky;
    top: 0;
    z-index: 1100;
}
.capability-inner {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.capability-pill {
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
}
.capability-pill.ok {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #d1fae5;
}
.capability-pill.cyan {
    background: #22d3ee;
    color: #000000;
}
.capability-inner pre {
    margin: 0.25rem 0 0 0;
    white-space: pre-wrap;
}

/* Conversion options UI */
.conversion-options {
    max-width: 900px;
    margin: 1rem auto 0;
    padding: 1rem;
}

.conversion-header {
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.options-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.option-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #334155;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
}

.option-pill input {
    accent-color: #6366f1;
}

.conversion-warning {
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
        letter-spacing: 2px;
        margin: 0.5rem 0 0 0;
    }
    
    .hero-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-icon {
        order: 1;
    }
    
    .hero-text {
        order: 2;
        align-items: center;
        text-align: center;
    }
    
    .hero-icon svg {
        width: 180px;
        height: 180px;
    }
    
    /* Mobile cloud adjustments will be handled dynamically */

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* Donate Section - Subtle placement before footer */
.donate-section {
    background: transparent;
    padding: 0.375rem 0; /* ~5pt top/bottom padding */
    margin: 2rem 0 0 0;
    display: none; /* Hidden by default, shown by JavaScript when content exists */
}

.donate-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.donate-additional {
    font-size: 0.75rem;
    font-weight: 200;
    color: #9ca3af;
    margin: 0 0 0.5rem 0;
    opacity: 0.7;
    line-height: 1.3;
    text-align: center;
}

.donate-additional a {
    color: #6b7280;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.donate-additional a:hover {
    color: #3b82f6;
}

.donate-text {
    font-size: 0.875rem;
    font-weight: 300;
    color: #6b7280;
    margin: 0;
    opacity: 0.8;
    line-height: 1.4;
}

.donate-text a {
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
}

.donate-text a:hover {
    color: white;
    opacity: 1;
    text-decoration: underline;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

/* Mobile adjustments for donate section */
@media (max-width: 768px) {
    .donate-section {
        padding: 0.3rem 0; /* Even smaller on mobile */
        margin: 1.5rem 0 0 0;
    }
    
    .donate-container {
        padding: 0 1rem;
    }
    
    .donate-additional {
        font-size: 0.7rem;
    }
    
    .donate-text {
        font-size: 0.8rem;
    }
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Mobile-specific utility classes */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.text-center {
    text-align: center;
}

.full-width-mobile {
    width: 100%;
}

.touch-friendly {
    min-height: 44px;
    min-width: 44px;
}

/* Safe area handling for devices with notches */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(2rem, env(safe-area-inset-left));
        padding-right: max(2rem, env(safe-area-inset-right));
    }
    
    .hero-container {
        padding-left: max(2rem, env(safe-area-inset-left));
        padding-right: max(2rem, env(safe-area-inset-right));
    }
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .full-width-mobile {
        width: 100%;
        max-width: 100%;
    }
    
    /* Safe area adjustments for mobile */
    @supports (padding: max(0px)) {
        .container {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
        
        .hero-container {
            padding-left: max(2rem, env(safe-area-inset-left));
            padding-right: max(2rem, env(safe-area-inset-right));
        }
        
        .toast-container {
            left: max(0.5rem, env(safe-area-inset-left));
            right: max(0.5rem, env(safe-area-inset-right));
        }
    }
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    min-width: 260px;
    max-width: 380px;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: #0b1220;
    background: #22d3ee;
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateX(120%);
    transition: transform 250ms ease, opacity 250ms ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(0%);
}
.toast.success { background: #34d399; }
.toast.warn { background: #fbbf24; }
.toast.error { background: #f87171; }
.toast.info { background: #60a5fa; }
.toast-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.toast-body pre { margin: 0.25rem 0 0 0; white-space: pre-wrap; }

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Modal/Popup System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Dark overlay, 90% opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* macOS-like easing */
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-body {
    text-align: justify;
    line-height: 1.2;
    color: #374151;
    margin-bottom: 2rem;
    font-size: 8pt;
    text-justify: inter-word;
}

.modal-body p {
    margin: 0;
    color: #374151;
    display: inline;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    font-size: 1rem;
}

.modal-btn.acknowledge {
    background: #2563eb;
    color: white;
}

.modal-btn.acknowledge:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.modal-btn.decline {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.modal-btn.decline:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Body dimming when modal is active */
body.modal-active {
    overflow: hidden;
}

body.modal-active .main-content {
    filter: brightness(0.1);
    transition: filter 0.3s ease;
}

/* Modal responsive styles */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        max-height: 90vh;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-btn {
        padding: 1.2rem 2rem;
        min-width: 160px;
    }
    
    /* Slot machine responsive */
    .uploader-subtitle {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .format-slot-machine {
        font-size: 1rem;
        width: 4.5em;
        height: 1.5em;
    }
    
    .format-item {
        height: 1.5em;
        line-height: 1.5em;
    }
    
    /* Enhanced mobile uploader experience */
    .uploader {
        padding: 2rem 0;
    }
    
    .uploader .container {
        padding: 0 1rem;
    }
    
    #uploader-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile dropzone optimization */
    .dropzone {
        min-height: 200px;
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .dropzone-title {
        font-size: 1.1rem;
    }
    
    .dropzone-subtitle {
        font-size: 0.9rem;
        margin: 0.5rem 0;
    }
    
    .dropzone-hint {
        font-size: 0.8rem;
    }
    
    /* Mobile button optimization */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 44px; /* Touch target size */
        min-width: 120px;
    }
    
    .btn-primary {
        padding: 1rem 2rem;
        min-height: 48px;
    }
    
    /* Mobile file list improvements */
    .file-item {
        padding: 1rem;
        margin: 0.75rem 0;
        border-radius: 8px;
    }
    
    .file-info h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .file-info p {
        font-size: 0.875rem;
    }
    
    /* Mobile toast positioning */
    .toast-container {
        right: 0.5rem;
        top: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
    
    .toast {
        max-width: none;
        margin: 0 0 0.5rem 0;
    }
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero h1 {
        font-size: 4rem;
    }
    
    .hero-tagline {
        font-size: 1.25rem;
        letter-spacing: 2.5px;
    }
    
    .hero-icon svg {
        width: 200px;
        height: 200px;
    }
    
    .uploader-subtitle {
        font-size: 1.3rem;
    }
    
    .format-slot-machine {
        width: 4.75em;
        height: 1.55em;
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

/* Large phone optimizations */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .hero-tagline {
        font-size: 0.9rem;
        letter-spacing: 1.5px;
        margin: 0.75rem 0 0 0;
    }
    
    .hero-icon svg {
        width: 140px;
        height: 140px;
    }
    
    .hero-container {
        gap: 0.75rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    /* Small screen uploader */
    #uploader-title {
        font-size: 1.5rem;
    }
    
    .uploader-subtitle {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }
    
    .format-slot-machine {
        font-size: 0.9rem;
        width: 4em;
        height: 1.4em;
    }
    
    .format-item {
        height: 1.4em;
        line-height: 1.4em;
        font-size: 0.9rem;
    }
    
    /* Mobile dropzone for small screens */
    .dropzone {
        min-height: 180px;
        padding: 1.25rem;
        margin: 1.25rem 0;
    }
    
    .dropzone-title {
        font-size: 1rem;
    }
    
    .dropzone-subtitle {
        font-size: 0.85rem;
    }
    
    .dropzone-hint {
        font-size: 0.75rem;
    }
    
    /* Small screen buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
        display: block;
    }
    
    .btn-primary {
        padding: 0.875rem 1.5rem;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 0.75rem;
    }
    
    .uploader .container {
        padding: 0 0.5rem;
    }
    
    /* Modal improvements for small screens */
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
        max-height: 95vh;
        width: calc(100vw - 1rem);
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        font-size: 6pt;
        max-height: 60vh;
    }
    
    .modal-btn {
        padding: 1rem 1.5rem;
        min-width: 120px;
        width: 100%;
        max-width: 200px;
    }
    
    .modal-actions {
        gap: 0.5rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-tagline {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
    
    .hero-icon svg {
        width: 120px;
        height: 120px;
    }
    
    .uploader-subtitle {
        font-size: 1rem;
    }
    
    .format-slot-machine {
        font-size: 0.85rem;
        width: 3.5em;
    }
    
    .dropzone {
        min-height: 160px;
        padding: 1rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .modal-content {
        margin: 0.25rem;
        padding: 0.75rem;
        width: calc(100vw - 0.5rem);
    }
    
    .modal-body {
        font-size: 5pt;
    }
}

/* Touch-friendly global improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .btn, button, .dropzone, .file-item, .modal-btn, .footer-link {
        cursor: default;
    }
    
    /* Larger touch targets */
    .btn, button {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Remove hover states on touch devices */
    .btn:hover, button:hover, .dropzone:hover,
    .footer-link:hover, .footer-image:hover {
        transform: none;
        box-shadow: none;
        filter: none;
    }
    
    /* Touch feedback with active states */
    .btn:active, button:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .dropzone:active {
        transform: scale(0.995);
        opacity: 0.95;
    }
}

/* High-DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-icon svg, .footer-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
        min-height: auto;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 0.85rem;
        margin: 0.5rem 0 0 0;
    }
    
    .hero-icon svg {
        width: 80px;
        height: 80px;
    }
    
    .hero-container {
        gap: 0.5rem;
    }
    
    .uploader {
        padding: 1.5rem 0;
    }
    
    .dropzone {
        min-height: 120px;
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* Dark mode support preparation */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
    /* Currently maintaining light theme for consistency */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-clouds {
        display: none;
    }
    
    .format-slot-machine {
        animation: none !important;
    }
    
    .format-reel {
        animation: none !important;
    }
}