/* Main CSS for Image Metadata Viewer & Editor */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #ecf5ff;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
    
    /* Additional variables for header/footer */
    --max-width: 1200px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --color-white: #ffffff;
    --color-light: #f1f5f9;
    --color-primary: #3498db;
    --color-primary-light: #dbeafe;
    --color-primary-dark: #2980b9;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    --color-error: #e74c3c;
    --color-info: #3498db;
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --color-background: #f8f9fa;
    --color-border: #dee2e6;
    --color-muted: #94a3b8;
    --color-dark: #1e293b;
    --color-border-dark: #334155;
}

/* Header Styles */
.site-header {
    background: #b7d5f8;
    border-bottom: none;
    box-shadow: none;
    position: relative;
    top: 0;
    z-index: 100;
    padding: 10px 0px;

}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.brand-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color:#0c3c70; /*  var(--text-primary) */
    line-height: 1.2;

}

.brand-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.header-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 10px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        margin-left: auto;
    }
    .menu-toggle .menu-label {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-left: 6px;
    }
    .header-navigation {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-white);
        border-top: 1px solid var(--border-color);
        display: none;
        z-index: 1000;
    }
    .header-navigation.open {
        display: block;
    }
    .nav-menu {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }
    .nav-item {
        width: 100%;
    }
    .nav-link {
        display: block;
        width: 100%;
        padding: 10px 12px;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--color-light);
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--color-primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.global-language-selector {
    display: flex;
    align-items: center;
}

.language-select-mini {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--color-white);
    font-size: 0.875rem;
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--color-light);
    border-color: var(--primary-color);
}

/* Footer Styles */
.site-footer {
    background: #d3e5fa;
    color: var(--color-text);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    border-top: none;
    box-shadow: none;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.footer-content,
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

.footer-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.footer-description {
    color: var(--color-muted);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.footer-links,
.footer-formats {
    list-style: none;
}

.footer-links li,
.footer-formats li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-formats li {
    color: var(--color-text-light);
}

.footer-contact p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.footer-email {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-email:hover {
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-copyright p {
    color: var(--color-muted);
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-legal a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: var(--primary-color);
}

.separator {
    color: var(--color-text-light);
}

.footer-version {
    color: var(--color-text-light);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.footer-version .version-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.footer-version .build-date {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Responsive Header/Footer */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: auto;
        padding: var(--spacing-sm) var(--spacing-md);
        gap: 0;
    }
    .header-brand { flex: 1; min-width: 0; }
    .brand-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.25rem; }
    .menu-toggle { margin-left: 8px; }
    
    .nav-menu {
        gap: var(--spacing-sm);
    }
    
    .nav-link {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.875rem;
    }
    
    .header-actions {
        gap: var(--spacing-sm);
    }
    
    .footer-content,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 1rem;
    margin-top: 28px;
    color: #1b4aaa;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.25rem;
    color: rgb(36 37 40 / 80%);
    font-size: 16px;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Constrain main content wrapper as well to avoid full-bleed backgrounds */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* Tagline Section */
.tagline-section {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    color: #712fff;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
    /* border-radius: 0 0 12px 12px; */
    /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); */
    width: 100%;
    margin-top: 1rem;
}

.tagline-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.tagline-text {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.025em;
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowShift 8s ease-in-out infinite;
}

@keyframes rainbowShift {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

/* Responsive tagline */
@media (min-width: 640px) {
    .tagline-text {
        font-size: 3.25rem;
        line-height: 1.1;
    }
}

@media (max-width: 640px) {
    .tagline-section {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .tagline-text {
        font-size: 2rem; /* Smaller for mobile */
        line-height: 1.2;
    }
}

.spacer-30 {
    height: 30px;
}

.spacer-25 {
    height: 25px;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Action card stays visible alongside upload and tabs */
.right-column {
    position: relative;
}

.action-card[data-sticky] {
    position: sticky;
    top: 90px;
}

/* Legal pages: force single-column layout */
.page-legal .main-layout {
    display: block;
}

.page-legal .container {
    max-width: var(--max-width);
}

.legal-content {
    max-width: 800px;
    margin: 2rem auto;
}

.legal-article h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--muted-text-color);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.legal-article h2 {
    margin-top: 1.5rem;
}

.legal-article p,
.legal-article li {
    line-height: 1.7;
}

/* Cards */
.upload-card,
.metadata-tabs-card,
.action-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.upload-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 2px dotted var(--border-color);
    transition: var(--transition);
}

.upload-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.upload-card.drag-over {
    border-color: var(--primary-color);
    background-color: #f0f9ff;
}

/* Upload Zone */
.upload-zone {
    width: 100%;
}

/* Place content and compact preview side-by-side */
.upload-zone {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1rem;
    align-items: start;
}

/* Compact preview grid inside upload area */
.file-preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin-top: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.35rem;
    background: var(--background-color);
}

.file-preview {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-background);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.file-preview img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* Improve responsive spacing using Bootstrap-like utilities if present */
.action-button-section {
    /* margin: 25px 0; */
    display: flex;
    margin-top: 0.1rem;
    justify-content: center;
}
.action-button-card {
    /* background: var(--color-white); */
    /* border-radius: var(--border-radius); */
    /* box-shadow: var(--shadow-sm); */
    /* padding: 20px; */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.file-name, .file-size {
    font-size: 0.75rem;
    line-height: 1.1;
}

.remove-file {
    margin-top: 0.35rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.remove-file.btn {
    border-radius: 999px;
}
.remove-file::before {
    content: '✕';
    font-size: 0.85rem;
}
.remove-file:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.4);
}
.remove-file:active {
    transform: translateY(1px);
}
.remove-file:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.6);
    outline-offset: 2px;
}

.file-preview:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Error Card */
.error-card {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-icon {
    font-size: 1.5rem;
}

.error-content h4 {
    color: var(--error-color);
    margin-bottom: 0.25rem;
}

.error-message {
    color: #991b1b;
    margin: 0;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
/* Tab Content Container - MUST BE VISIBLE */
.tab-content {
    display: block !important;
    padding: 1rem 0;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Metadata Table */
.metadata-table-card {
    /* background: var(--card-background); */
    border-radius: var(--border-radius);
    padding: 1rem;
    /* Remove fixed max-height and scrolling to allow auto expansion */
    max-height: none;
    overflow: visible;
}

.metadata-table {
    width: 100%;
}

.metadata-section {
    margin-bottom: 2rem;
}

.metadata-section h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.metadata-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.metadata-row:last-child {
    border-bottom: none;
}

.metadata-label {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 200px;
    flex: 1;
}

.metadata-value {
    color: var(--text-secondary);
    text-align: right;
    word-break: break-word;
    max-width: 95%;
    flex: 2;
}

/* Field Groups */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.field-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
}

.field-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.field-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Advanced Section */
.advanced-section {
    margin-top: 2rem;
}

.advanced-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.advanced-toggle:hover {
    color: var(--primary-hover);
}

.advanced-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Section Titles */
.section-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Keywords Input */
.keywords-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: 50px;
}

.keyword-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.keyword-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

/* Rating Widget */
.rating-widget {
    display: flex;
    gap: 0.25rem;
}

.star {
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: var(--transition);
}

.star:hover,
.star.active {
    color: #fbbf24;
}

/* GPS Inputs */
.gps-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.gps-input {
    width: 100%;
}

/* Right Column */
.right-column {
    position: static;
    top: auto;
    height: auto;
}

.action-card {
    position: sticky;
    top: 2rem;
}

/* Language Selector */
.language-selector {
    margin-bottom: 1.5rem;
}

.language-selector label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.language-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: var(--card-background);
}

/* Mode Toggle */
.mode-toggle {
    margin-bottom: 1.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Buttons */
.submit-button,
.download-button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.submit-button {
    background: var(--primary-color);
    color: white;
}

.submit-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.download-button {
    background: var(--success-color);
    color: white;
}

.download-button:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.submit-button:disabled,
.download-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress Indicator */
.progress-indicator {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .action-card[data-sticky] {
        position: static;
        top: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .upload-card,
    .metadata-tabs-card,
    .action-card {
        padding: 1rem;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .field-row {
        gap: 0.25rem;
    }
    
    .gps-inputs {
        grid-template-columns: 1fr;
    }
    
    .metadata-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .metadata-value {
        text-align: left;
    }
    .upload-zone {
        grid-template-columns: 1fr;
    }
    .file-preview-grid {
        max-height: 160px;
    }
    .file-preview img {
        height: 90px;
    }
}

@media (max-width: 480px) {
    .upload-card {
        min-height: 150px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .upload-title {
        font-size: 1.25rem;
    }
    
    .upload-subtitle {
        font-size: 0.8rem;
    }
    
    .file-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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

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

.hidden { display: none; }
.visible { display: block; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus States */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .action-card,
    .upload-card,
    .tab-navigation {
        display: none;
    }
    
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .metadata-table-card {
        max-height: none;
        overflow: visible;
    }
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* center content horizontally */
    gap: 1rem;
    text-align: center; /* center text */
}

.upload-header {
    display: flex;
    align-items: center;
    justify-content: center; /* center icon + title line */
    gap: 0.75rem;
}

/* Stack subtitle below title */
.upload-text {
    display: flex;
    flex-direction: column;
    align-items: center; /* center stacked text */
    gap: 0.25rem;
    text-align: center;
}

/* Make the main line more prominent */
.upload-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.upload-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Modern upload button */
.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background:  #000000cd; /*linear-gradient(180deg, var(--primary-color) 0%, var(--primary-hover) 100%);*/
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.7rem 1.25rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}
.upload-button::before {
    content: '📤';
    font-size: 1.1rem;
    line-height: 1;
}
.upload-button:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
    filter: brightness(1.02);
}
.upload-button:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.upload-button:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.65);
    outline-offset: 2px;
}
.upload-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Harmonize with Bootstrap btn when applied */
.upload-button.btn {
    border: none;
}

/* RTL overrides */
[dir="rtl"] .header-container { direction: rtl; }
[dir="rtl"] .header-navigation .nav-menu { flex-direction: row-reverse; }
[dir="rtl"] .nav-link { text-align: right; }
[dir="rtl"] .metadata-row { flex-direction: row-reverse; }
[dir="rtl"] .metadata-label { text-align: right; }
[dir="rtl"] .metadata-value { text-align: left; }
