:root {
    --primary-orange: #ff3d00;
    --primary-blue: #003278;
    --primary-orange-light: #ff6a3d;
    --primary-orange-dark: #cc3100;
    --primary-blue-light: #004a9e;
    --primary-blue-dark: #002855;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

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

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-blue-light);
}

.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.ad-banner {
    padding: 0.5rem 0;
    text-align: center;
}

.ad-placeholder {
    background: var(--gray-100);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 0.75rem;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-label {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.navbar {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu a {
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.15);
}

.language-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
}

.language-selector select option {
    color: var(--gray-800);
    background: var(--white);
}

.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.converter-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.converter-box h1 {
    color: var(--primary-blue);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--gray-50);
}

.file-input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: var(--gray-100);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary-orange);
    color: var(--white);
}

.tab-content {
    display: none;
}

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

#file-input {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--primary-orange);
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--white);
    transition: all 0.2s;
}

.file-label:hover {
    border-color: var(--primary-orange-dark);
    background: rgba(255, 61, 0, 0.05);
}

.file-label .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

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

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.file-size {
    color: var(--gray-500);
    font-size: 0.75rem;
    margin-left: 1rem;
}

.btn-remove {
    background: var(--gray-200);
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--gray-600);
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--primary-orange);
    color: var(--white);
}

.url-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.url-input-wrapper input {
    flex: 1;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-orange);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-orange-dark);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-convert {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.conversion-options {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.option-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.option-group select,
.option-group input[type="text"],
.option-group input[type="url"],
.option-group input[type="number"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 61, 0, 0.1);
}

.dimensions-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dimensions-inputs input {
    width: 100px;
}

.results-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.results-box h2 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.results-table th,
.results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.results-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.results-table td {
    font-size: 0.875rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.results-actions {
    display: flex;
    justify-content: flex-end;
}

.steps-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.steps-box h3 {
    color: var(--primary-blue);
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.steps-list {
    padding-left: 1.5rem;
}

.steps-list li {
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0;
    margin-top: 2rem;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--gray-600);
    font-size: 0.875rem;
}

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

@media (max-width: 768px) {
    .navbar-content {
        flex-wrap: wrap;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .converter-box,
    .results-box,
    .steps-box {
        padding: 1rem;
    }

    .conversion-options {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 0.75rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-orange);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-orange);
    cursor: pointer;
    border: none;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
