:root {
    --primary-color: #003366;
    --secondary-color: #78C8EF;
    --primary-gradient: linear-gradient(135deg, #003366 0%, #004d99 100%);
    --secondary-gradient: linear-gradient(135deg, #78C8EF 0%, #5AB3E0 100%);
    --accent-gradient: linear-gradient(135deg, #003366 0%, #78C8EF 100%);
    --background: #f5f8fa;
    --surface: #ffffff;
    --surface-hover: #f0f4f8;
    --text-primary: #003366;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0, 51, 102, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 51, 102, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom, #f5f8fa 0%, #e8f1f8 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(120, 200, 239, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 51, 102, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 51, 102, 0.3));
    animation: float 3s ease-in-out infinite;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    animation: fadeInUp 0.8s ease-out;
}

.converter-card {
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;

    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.converter-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.file-input-wrapper {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafcfe;
}

.file-input-wrapper:hover {
    border-color: var(--secondary-color);
    background: rgba(120, 200, 239, 0.1);
}

.file-input-wrapper.drag-over {
    border-color: var(--secondary-color);
    background: rgba(120, 200, 239, 0.15);
    transform: scale(1.02);
}

.upload-placeholder h3 {
    font-size: 1.5rem;
    margin: 20px 0 8px;
    color: var(--text-primary);
}

.upload-placeholder p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 16px;
}

.file-types {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(120, 200, 239, 0.2);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(120, 200, 239, 0.15);
    border-radius: 12px;
}

.file-icon {
    font-size: 2.5rem;
}

.file-details {
    flex: 1;
    text-align: left;
}

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

.file-size {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.remove-file {
    background: #e2e8f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.remove-file:hover {
    background: #cbd5e0;
    transform: rotate(90deg);
}

/* Sheet Selector */
.sheet-selector {
    margin-bottom: 30px;
    padding: 24px;
    background: rgba(120, 200, 239, 0.05);
    border-radius: 16px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s ease-out;
}

.sheet-selector h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.sheet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.sheet-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sheet-item:hover {
    border-color: var(--secondary-color);
    background: rgba(120, 200, 239, 0.05);
}

.sheet-item.selected {
    border-color: var(--secondary-color);
    background: rgba(120, 200, 239, 0.1);
}

.sheet-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.sheet-item-info {
    flex: 1;
}

.sheet-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sheet-item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.merge-option {
    margin: 20px 0;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    user-select: none;
}

#btnProcessSheets {
    width: 100%;
    justify-content: center;
}

/* Data Type Configuration */
.data-type-config {
    margin-bottom: 30px;
    padding: 24px;
    background: rgba(120, 200, 239, 0.05);
    border-radius: 16px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s ease-out;
}

.data-type-config h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.help-text {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-tertiary);
}

.column-type-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.column-type-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.column-type-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.column-type-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.column-type-select:hover {
    border-color: var(--secondary-color);
}

.column-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

/* Conversion Options */
.conversion-options {
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.conversion-options h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.format-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text-primary);
}

.format-btn:hover {
    background: rgba(120, 200, 239, 0.15);
    border-color: var(--secondary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(120, 200, 239, 0.3);
}

.format-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 51, 102, 0.3);
}

.format-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.format-icon {
    font-size: 2rem;
}

.format-name {
    font-weight: 600;
    font-size: 1rem;
}

/* Preview Section */
.preview-section {
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.preview-section h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.preview-container {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    max-height: 400px;
    overflow: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.preview-container::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
}

.preview-table th {
    background: rgba(120, 200, 239, 0.2);
    font-weight: 600;
    color: var(--text-primary);
}

.preview-table td {
    color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    animation: fadeIn 0.5s ease-out;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.25);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(0, 51, 102, 0.35);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.feature-card {
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: #f7fafc;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.feature-card:nth-child(2) .feature-icon {
    animation-delay: 1s;
}

.feature-card:nth-child(3) .feature-icon {
    animation-delay: 2s;
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .converter-card {
        padding: 24px;
    }

    .file-input-wrapper {
        padding: 40px 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}