:root {
    --primary: #667eea;
    --primary-hover: #5a6fd6;
    --secondary-color: #764ba2;
    --dark-bg: #2c3e50;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1f2937;
    --text-light: #6b7280;
    --success: #28a745;
    --success-hover: #218838;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary-color) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-top: 40px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
    text-align: center;
    background: var(--dark-bg);
    color: white;
    padding: 35px 20px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto;
}

.privacy-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 1rem auto 0;
    width: fit-content;
}

/* Card Layout */
.card {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid #e9ecef;
    margin: 0 1.5rem 2rem 1.5rem;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: var(--dark-bg);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--primary);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #f8f9fa;
    margin: 1.5rem;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--secondary-color);
    background: #e9ecef;
}

.upload-icon {
    margin-bottom: 1rem;
    color: var(--primary);
    pointer-events: none;
}

.upload-text {
    font-weight: 500;
    margin-bottom: 0.3rem;
    pointer-events: none;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    pointer-events: none;
}

.supported-formats {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 0.7rem 1.2rem;
    border-radius: 40px;
    margin: 0 1.5rem 1rem;
    font-size: 0.9rem;
}

/* Settings Panel */
.settings-panel {
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.5rem;
    border-top: 1px solid var(--border);
    background: #f8f9fa;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 140px;
}

.option-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.option-select {
    padding: 0.6rem 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    outline: none;
    transition: border var(--transition);
    cursor: pointer;
}

.option-select:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: #f1f5f9;
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Progress Bar */
.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    margin: 0.5rem 0 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Preview Section */
.preview-container {
    padding: 1.5rem;
    overflow-x: auto;
    background: #f8f9fa;
    border-top: 1px solid var(--border);
}

.preview-table-wrapper {
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: inline-block;
    min-width: 100%;
}

.preview-table {
    border-collapse: collapse;
    font-size: 0.85rem;
    width: 100%;
}

.preview-table td,
.preview-table th {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    min-width: 80px;
    background: white;
}

.preview-table th {
    background: #f3f4f6;
    font-weight: 600;
    text-align: center;
}

.sheet-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sheet-tab {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.sheet-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.sheet-tab:hover:not(.active) {
    background: #f3f4f6;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1f2937;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 1.5rem;
}

.feature-item {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(102, 126, 234, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Back Button & Navigation */
.back-button {
    position: fixed;
    top: 10px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.breadcrumb-nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 10px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

.breadcrumb [aria-current="page"] {
    color: white;
    font-weight: 600;
}

/* Tool Switcher */
.tool-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 16px;
    margin: 0 auto 16px;
    max-width: 1000px;
}

.tool-switch-btn {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-switch-btn.active {
    background: white;
    color: #667eea;
    font-weight: 700;
}

.tool-switcher-label {
    color: rgba(255, 255, 255, 0.75);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Related Tools */
.related-tools {
    padding: 30px;
    text-align: center;
    border-top: 1px solid #eee;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #e9ecef;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
}

.related-link:hover {
    background: #667eea;
    color: white;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.85);
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    border-radius: 0 0 16px 16px;
    margin-top: 0;
}

footer a {
    color: white;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 50px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .settings-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .preview-table {
        font-size: 0.75rem;
    }

    .preview-table td,
    .preview-table th {
        padding: 0.3rem 0.5rem;
    }

    .card {
        margin: 0 0.5rem 1.5rem 0.5rem;
    }

    .features-grid {
        margin: 2rem 0.5rem;
    }
}