:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --bg-color: #0c0e12;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --glass-blur: blur(20px);
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, #1e1b4b 0%, #0c0e12 50%),
                radial-gradient(circle at 90% 90%, #312e81 0%, #0c0e12 50%);
    z-index: -1;
}

.app-container {
    max-width: 800px;
    width: 95%;
    padding: 2rem 0;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Back Link Styling */
.nav-back {
    display: flex;
    margin-bottom: 2rem;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.25rem;
    border-radius: 3rem;
    border: 1px solid var(--border-color);
}

.back-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary);
    transform: translateX(-5px);
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.main-icon {
    width: 56px;
    height: 56px;
    color: var(--primary);
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.5));
}

.rotate-icon {
    animation: rotate 20s linear infinite;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 550px;
    line-height: 1.6;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    padding: 3rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all var(--transition-speed);
}

.card.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.card.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Upload Section */
.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: 1.5rem;
    padding: 5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover, .drop-zone.hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.02);
}

.upload-icon {
    width: 72px;
    height: 72px;
    color: var(--primary);
    margin-bottom: 2rem;
    transition: transform 0.3s;
}

.drop-zone:hover .upload-icon {
    transform: translateY(-10px);
}

.drop-content h3 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.drop-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Config Grid */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.config-item label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-select {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    width: fit-content;
}

/* Subheaders */
.subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.subheader h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

/* Column Selection Items */
.column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.column-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.column-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--secondary);
}

.column-item.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.column-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.selected .column-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.column-checkbox i {
    color: white;
    width: 14px;
    height: 14px;
    display: none;
}

.selected .column-checkbox i {
    display: block;
}

.column-name {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Preview Area */
.preview-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.preview-scroll {
    width: 100%;
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

#preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

#preview-table th {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text-secondary);
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 2px solid var(--border-color);
}

#preview-table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

#preview-table tr:last-child td {
    border-bottom: none;
}

#preview-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Custom scrollbar for preview */
.preview-scroll::-webkit-scrollbar {
    height: 8px;
}

.preview-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Action Buttons */
.card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-primary, .btn-secondary {
    padding: 1rem 1.75rem;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--secondary);
}

/* Success Section */
.success-content {
    text-align: center;
    padding: 2rem 0;
}

.success-icon-wrapper {
    width: 100px;
    height: 100px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

.success-icon {
    width: 60px;
    height: 60px;
    color: var(--success);
}

.success-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.app-container {
    max-width: 800px;
    width: 95%;
    padding: 4rem 0 10rem 0;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, var(--bg-color) 60%, transparent);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    pointer-events: none;
}

footer > * {
    pointer-events: auto;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--success);
    padding: 0.8rem 1.8rem;
    border-radius: 3rem;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Custom Scrollbar */
.column-grid::-webkit-scrollbar {
    width: 6px;
}

.column-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .card { padding: 2rem 1.5rem; }
    .config-grid { grid-template-columns: 1fr; gap: 1rem; }
    h1 { font-size: 2.25rem; }
    .subheader { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
