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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #c41e3a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Container */
.container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

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

/* Typography */
h1 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 2em;
    background: linear-gradient(135deg, #1e3c72, #c41e3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9em;
}

.preview-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #1e3c72;
}

/* Upload Area */
.upload-area {
    display: block;
    border: 3px dashed #2a5298;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(42, 82, 152, 0.05);
}

.upload-area:hover {
    border-color: #c41e3a;
    background: rgba(196, 30, 58, 0.05);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #c41e3a;
    background: rgba(196, 30, 58, 0.1);
    transform: scale(1.05);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* File Info Section */
.file-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(42, 82, 152, 0.1);
    border-radius: 10px;
    display: none;
    animation: fadeIn 0.5s ease;
}

.conversion-notice {
    margin-top: 15px;
    padding: 10px;
    background: rgba(196, 30, 58, 0.1);
    border-left: 3px solid #c41e3a;
    border-radius: 5px;
    color: #1e3c72;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
}

.info-label {
    font-weight: 600;
    color: #1e3c72;
}

.info-value {
    color: #333;
}

/* Export Name Section */
.export-name-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 2px solid rgba(42, 82, 152, 0.2);
    display: none;
}

.export-name-label {
    display: block;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 10px;
}

.export-name-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #2a5298;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.export-name-input:focus {
    outline: none;
    border-color: #c41e3a;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* Preview Section */
.preview-section {
    margin-top: 30px;
    display: none;
}

.preview-table {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: rgba(42, 82, 152, 0.05);
}

/* Column Selector */
.column-selector {
    margin-top: 30px;
    display: none;
}

.columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.column-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.column-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-color: #2a5298;
}

.column-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #c41e3a;
}

.column-item label {
    cursor: pointer;
    flex: 1;
    color: #444;
}

/* Preset Section */
.preset-section {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(196, 30, 58, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(196, 30, 58, 0.2);
}

.preset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preset-title {
    font-weight: 600;
    color: #c41e3a;
}

.save-preset-btn {
    padding: 8px 15px;
    background: #c41e3a;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.save-preset-btn:hover {
    background: #a01729;
    transform: translateY(-2px);
}

.preset-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.preset-item:hover {
    border-color: #2a5298;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.preset-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.preset-name:hover {
    color: #2a5298;
}

.preset-actions {
    display: flex;
    gap: 5px;
}

.preset-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.preset-apply {
    background: #2a5298;
    color: white;
}

.preset-apply:hover {
    background: #1e3c72;
}

.preset-edit {
    background: #f39c12;
    color: white;
}

.preset-edit:hover {
    background: #e67e22;
}

.preset-delete {
    background: #e74c3c;
    color: white;
}

.preset-delete:hover {
    background: #c0392b;
}

.no-presets {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Select Controls */
.select-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.select-btn {
    padding: 8px 15px;
    border: 1px solid #2a5298;
    background: white;
    color: #2a5298;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-btn:hover {
    background: #2a5298;
    color: white;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #c41e3a, #e74c3c);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(196, 30, 58, 0.3);
}

.btn-secondary {
    background: #2a5298;
    color: white;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #1e3c72, #c41e3a);
    width: 0;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Status Messages */
.status-message {
    text-align: center;
    margin-top: 15px;
    color: #2a5298;
    font-style: italic;
    display: none;
}

.error-message {
    color: #c41e3a;
    background: rgba(196, 30, 58, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    margin: 10% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    animation: slideIn 0.3s ease;
}

.modal-header {
    font-size: 1.3em;
    color: #1e3c72;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #2a5298;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-save {
    background: #2a5298;
    color: white;
}

.modal-save:hover {
    background: #1e3c72;
}

.modal-cancel {
    background: #e0e0e0;
    color: #555;
}

.modal-cancel:hover {
    background: #d0d0d0;
}