/**
 * eRechnung.new - Main Stylesheet
 * Custom styles for the invoice conversion application
 */

/* CSS Custom Properties */
:root {
    --primary-color: #F9BD00;
    --primary-dark: #d9a300;
    --primary-light: #ffd740;
}

/* Drop Zone Styles */
.drop-zone {
    transition: all 0.3s ease;
    border: 3px dashed #cbd5e1;
}

.drop-zone.dragover {
    background-color: #fffbeb;
    border-color: var(--primary-color);
    transform: scale(1.01);
}

/* JSON Syntax Highlighting */
.json-key {
    color: #7c3aed;
    font-weight: 600;
}

.json-string {
    color: #059669;
}

.json-number {
    color: #dc2626;
}

.json-null {
    color: #6b7280;
}

/* PDF Canvas */
#pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    height: auto !important;
    width: auto !important;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

/* Responsive PDF Container Height */
@media (min-width: 1024px) and (max-height: 900px) {
    #results-section .lg\:sticky > div {
        height: calc(100vh - 120px) !important;
    }
}

@media (min-width: 1024px) and (max-height: 768px) {
    #results-section .lg\:sticky > div {
        height: calc(100vh - 140px) !important;
    }
}

/* Loading Spinner */
.loader {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Validation Toggle Icon */
#validation-toggle-icon {
    transition: transform 0.3s ease;
}

/* Primary Color Utilities */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color);
}

.border-primary {
    border-color: var(--primary-color);
}

.bg-primary-light {
    background-color: #fffbeb;
}

.text-primary-dark {
    color: var(--primary-dark);
}

.hover\:bg-primary-dark:hover {
    background-color: var(--primary-dark);
}


/* Text Decoration */
.double-underline {
    text-decoration: underline;
    text-decoration-style: double;
}

/* Input Validation Styles */
input:invalid:not(:placeholder-shown) {
    border-color: #dc2626 !important;
    background-color: #fef2f2;
}

input:invalid:not(:placeholder-shown):focus {
    ring-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Validierung Tooltip */
input[type="email"]:invalid:not(:placeholder-shown),
input[pattern]:invalid:not(:placeholder-shown) {
    position: relative;
}

/* Responsive Scaling for smaller laptops and compact screens */
@media (min-width: 1024px) and (max-height: 900px) {
    /* Scale based on viewport height for better fit on smaller screens */
    html {
        font-size: 13px; /* Scale down base font size more aggressively */
    }
    
    /* Smaller upload section */
    #upload-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    #upload-section .drop-zone {
        padding: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    /* Compact header spacing */
    #main-header {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* Reduce logo and header spacing */
    #upload-section .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    #upload-section .mb-12 {
        margin-bottom: 1.5rem !important;
    }
}

/* Additional scaling for very compact screens */
@media (min-width: 1024px) and (max-height: 768px) {
    html {
        font-size: 12px;
    }
    
    #upload-section {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Download Page Animations */
#countdown-seconds {
    display: inline-block;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.15); 
        opacity: 0.9;
    }
}

.download-success-icon {
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    0% { 
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Fade-in for download section */
#download-section {
    animation: fadeIn 0.5s ease-out;
}

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

