:root {
    /* Light theme */
    --light-bg: #f8fafc;
    --light-text: #1e293b;
    --light-text-secondary: #64748b;
    --light-border: #e2e8f0;
    --light-card-bg: #ffffff;
    --light-accent: #2563eb;
    --light-accent-hover: #1d4ed8;
    --light-secondary: #64748b;
    
    /* Dark theme */
    --dark-bg: #0f172a;
    --dark-text: #ffffff;
    --dark-text-secondary: #cbd5e1;
    --dark-border: #334155;
    --dark-card-bg: #1e293b;
    --dark-card-hover: #283548;
    --dark-accent: #38bdf8;
    --dark-accent-hover: #0ea5e9;
    --dark-secondary: #94a3b8;
    --dark-input-bg: #1a2234;
    --dark-success: #059669;
    --dark-error: #dc2626;
}

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

/* Theme specific styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    padding-top: 5rem !important;
    line-height: 1.6;
}

body.light-theme {
    background-color: var(--light-bg);
    color: var(--light-text);
}

body.dark-theme {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* Layout and spacing */
.main-container {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 0 1.5rem !important;
}

.main-content {
    padding: 2rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* Top Menu */
.ui.top.fixed.menu {
    background-color: var(--light-card-bg);
    border-bottom: 1px solid var(--light-border);
    height: 4rem;
}

.ui.top.fixed.menu .item {
    color: var(--light-text);
    font-weight: 500;
}

.ui.top.fixed.menu .item:hover {
    color: var(--light-accent);
}

/* Headers */
.ui.header {
    margin: 2rem 0 !important;
}

.ui.header .icon {
    font-size: 2em !important;
    margin-bottom: 0.5rem !important;
}

.ui.header .sub.header {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    color: var(--light-text-secondary);
}

/* Tabs */
.ui.pointing.secondary.menu {
    margin: 2rem 0 !important;
    border-bottom: 2px solid var(--light-border);
}

.ui.pointing.secondary.menu .item {
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.ui.pointing.secondary.menu .item.active {
    border-color: var(--light-accent);
    color: var(--light-accent);
}

/* Form elements */
.ui.form .field {
    margin-bottom: 2rem;
}

.ui.form label {
    font-weight: 500 !important;
    margin-bottom: 0.75rem !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.ui.form label .icon {
    color: var(--light-accent);
}

textarea {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid var(--light-border) !important;
    transition: all 0.2s ease !important;
    resize: vertical !important;
}

textarea:focus {
    border-color: var(--light-accent) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important;
}

/* Buttons */
.ui.primary.button {
    background-color: var(--light-accent) !important;
    color: white !important;
    font-weight: 500 !important;
    padding: 1rem 1.5rem !important;
    height: auto !important;
    transition: all 0.2s ease !important;
}

.ui.primary.button:hover {
    background-color: var(--light-accent-hover) !important;
    transform: translateY(-1px);
}

.ui.two.buttons {
    margin-top: 1.5rem;
    gap: 1rem;
}

.ui.two.buttons .button {
    margin: 0 !important;
    padding: 1rem !important;
}

/* Messages */
.ui.icon.info.message {
    background-color: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--light-accent);
    color: var(--light-text);
    box-shadow: none;
}

.ui.icon.info.message .header {
    color: var(--light-accent);
    font-weight: 600;
}

.ui.icon.info.message .icon {
    color: var(--light-accent);
    opacity: 1;
}

/* Dark theme overrides */
body.dark-theme .ui.top.fixed.menu {
    background-color: var(--dark-card-bg);
    border-color: var(--dark-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-theme .ui.top.fixed.menu .item {
    color: var(--dark-text);
}

body.dark-theme .ui.top.fixed.menu .item:hover {
    color: var(--dark-accent);
    background-color: var(--dark-card-hover);
}

body.dark-theme .ui.segment {
    background-color: var(--dark-card-bg);
    border-color: var(--dark-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.dark-theme .ui.header,
body.dark-theme .ui.header .content {
    color: var(--dark-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-theme .ui.header .sub.header {
    color: var(--dark-text-secondary);
}

body.dark-theme .ui.pointing.secondary.menu {
    border-color: var(--dark-border);
}

body.dark-theme .ui.pointing.secondary.menu .item {
    color: var(--dark-text);
    transition: all 0.2s ease;
}

body.dark-theme .ui.pointing.secondary.menu .item:hover {
    color: var(--dark-text);
    background-color: var(--dark-card-hover);
}

body.dark-theme .ui.pointing.secondary.menu .item.active {
    border-color: var(--dark-accent);
    color: var(--dark-accent);
}

body.dark-theme .ui.form label {
    color: var(--dark-text) !important;
}

body.dark-theme .ui.form label .icon {
    color: var(--dark-accent);
}

body.dark-theme .ui.form input,
body.dark-theme .ui.form textarea {
    background-color: var(--dark-input-bg) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-border) !important;
}

body.dark-theme .ui.form input:focus,
body.dark-theme .ui.form textarea:focus {
    border-color: var(--dark-accent) !important;
    background-color: var(--dark-bg) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15) !important;
}

body.dark-theme .ui.form input::placeholder,
body.dark-theme .ui.form textarea::placeholder {
    color: var(--dark-text-secondary);
}

body.dark-theme .ui.primary.button {
    background-color: var(--dark-accent) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

body.dark-theme .ui.primary.button:hover {
    background-color: var(--dark-accent-hover) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}

body.dark-theme .ui.icon.info.message {
    background-color: rgba(56, 189, 248, 0.1);
    border-color: var(--dark-accent);
    color: var(--dark-text);
}

body.dark-theme .ui.icon.info.message .header {
    color: var(--dark-accent);
}

body.dark-theme .ui.icon.info.message .icon {
    color: var(--dark-accent);
}

body.dark-theme .ui.list .item {
    border-color: var(--dark-border);
}

body.dark-theme .ui.list .item:hover {
    background-color: var(--dark-card-hover);
}

body.dark-theme .ui.progress {
    background-color: var(--dark-input-bg);
}

body.dark-theme .ui.progress .bar {
    background-color: var(--dark-accent);
}

body.dark-theme .ui.success.message {
    background-color: var(--dark-success);
    color: white;
}

body.dark-theme .ui.error.message {
    background-color: var(--dark-error);
    color: white;
}

body.dark-theme .ui.toast {
    background-color: var(--dark-card-bg);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark-theme .ui.toast.success {
    background-color: var(--dark-success);
    color: white;
}

body.dark-theme .ui.toast.error {
    background-color: var(--dark-error);
    color: white;
}

/* Dark theme scrollbar */
body.dark-theme .files-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .files-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding-top: 4rem !important;
    }

    .main-container {
        padding: 0 1rem !important;
    }

    .main-content {
        padding: 1.5rem !important;
    }

    .ui.header {
        margin: 1.5rem 0 !important;
    }

    .ui.header .icon {
        font-size: 1.5em !important;
    }

    .ui.header .sub.header {
        font-size: 1rem;
    }

    .ui.pointing.secondary.menu .item {
        padding: 0.75rem 1rem;
    }

    .ui.two.buttons {
        flex-direction: column;
    }

    .ui.two.buttons .button {
        width: 100%;
        margin: 0.5rem 0 !important;
    }
}

.files-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 1rem;
    scrollbar-width: thin;
}

.files-list::-webkit-scrollbar {
    width: 8px;
}

.files-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* For dark theme */
.dark-theme .files-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .files-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark-theme .files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Light theme specific overrides */
body.light-theme .ui.header,
body.light-theme .ui.header .content {
    color: var(--light-text);
}

body.light-theme .ui.header .sub.header {
    color: var(--light-text-secondary);
}

body.light-theme textarea,
body.light-theme input[type="text"] {
    color: var(--light-text) !important;
    background-color: var(--light-card-bg) !important;
}

body.light-theme textarea::placeholder,
body.light-theme input[type="text"]::placeholder {
    color: var(--light-text-secondary) !important;
}

body.light-theme .files-list .item {
    color: var(--light-text);
}

body.light-theme .ui.message {
    color: var(--light-text);
}

body.light-theme .ui.message .header {
    color: var(--light-text);
}

/* Dark theme overrides - ensure white text */
body.dark-theme,
body.dark-theme .ui.segment,
body.dark-theme .ui.header,
body.dark-theme .ui.header .content,
body.dark-theme .ui.form label,
body.dark-theme .ui.form input,
body.dark-theme .ui.form textarea,
body.dark-theme .ui.list .item,
body.dark-theme .ui.list .header,
body.dark-theme .ui.message,
body.dark-theme .ui.message .header,
body.dark-theme .ui.label,
body.dark-theme .files-list .item,
body.dark-theme .ui.statistics .statistic .value,
body.dark-theme .ui.statistics .statistic .label,
body.dark-theme .ui.menu .item,
body.dark-theme .ui.pointing.secondary.menu .item,
body.dark-theme textarea,
body.dark-theme input[type="text"],
body.dark-theme .ui.tab.segment,
body.dark-theme .ui.raised.padded.segment {
    color: var(--dark-text) !important;
}

body.dark-theme .ui.form input::placeholder,
body.dark-theme .ui.form textarea::placeholder,
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: var(--dark-text-secondary) !important;
}

body.dark-theme .ui.segment,
body.dark-theme .ui.raised.padded.segment,
body.dark-theme .ui.tab.segment {
    background-color: var(--dark-card-bg);
}

body.dark-theme .ui.form input,
body.dark-theme .ui.form textarea,
body.dark-theme input[type="text"],
body.dark-theme textarea {
    background-color: var(--dark-card-bg) !important;
    border-color: var(--dark-border) !important;
}

/* Ensure links are visible in dark mode */
body.dark-theme a,
body.dark-theme .ui.menu a.item {
    color: var(--dark-text);
}

body.dark-theme a:hover,
body.dark-theme .ui.menu a.item:hover {
    color: var(--dark-accent);
}

/* Make sure buttons have proper contrast */
body.dark-theme .ui.button {
    background-color: #2d3748 !important;
    color: #ffffff !important;
    border: 1px solid #4a5568 !important;
}

body.dark-theme .ui.button:hover {
    background-color: #4a5568 !important;
    border-color: #718096 !important;
}

body.dark-theme .ui.primary.button {
    background-color: #3182ce !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .ui.primary.button:hover {
    background-color: #2c5282 !important;
}

body.dark-theme .ui.teal.button {
    background-color: #319795 !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .ui.teal.button:hover {
    background-color: #2c7a7b !important;
}

body.dark-theme .ui.blue.button {
    background-color: #4299e1 !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .ui.blue.button:hover {
    background-color: #3182ce !important;
}

body.dark-theme .ui.olive.button {
    background-color: #718096 !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .ui.olive.button:hover {
    background-color: #4a5568 !important;
}

/* Ensure modal content is visible in dark mode */
body.dark-theme .ui.modal,
body.dark-theme .ui.modal .header,
body.dark-theme .ui.modal .content,
body.dark-theme .ui.modal .actions {
    background-color: var(--dark-card-bg) !important;
    color: var(--dark-text) !important;
}

/* Make sure icons are visible */
body.dark-theme .icon {
    color: var(--dark-text) !important;
}

body.dark-theme .ui.info.message .icon,
body.dark-theme .ui.header .icon {
    color: var(--dark-accent) !important;
}

.ui.mini.label {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

body.light-theme .ui.mini.label {
    background-color: #e2e8f0;
    color: #1e293b !important;
}

body.dark-theme .ui.mini.label {
    background-color: var(--dark-card-hover);
    color: var(--dark-text) !important;
}

/* File count label specific styles */
#file-count {
    font-weight: 600;
}

body.light-theme #file-count {
    background-color: #e2e8f0;
    color: #1e293b !important;
}

body.dark-theme #file-count {
    background-color: var(--dark-card-hover);
    color: var(--dark-text) !important;
}

/* Make sure labels are readable in dark mode */
body.dark-theme .ui.label,
body.dark-theme .ui.mini.label {
    background-color: #2d3748 !important;
    color: #ffffff !important;
    border: 1px solid #4a5568 !important;
}

/* Ensure text inputs and textareas are readable */
body.dark-theme input[type="text"],
body.dark-theme textarea {
    background-color: #2d3748 !important;
    color: #ffffff !important;
    border: 1px solid #4a5568 !important;
}

body.dark-theme input[type="text"]:focus,
body.dark-theme textarea:focus {
    background-color: #1a202c !important;
    border-color: #3182ce !important;
    color: #ffffff !important;
}

/* Make sure modal buttons are visible */
body.dark-theme .ui.modal .actions .button {
    background-color: #2d3748 !important;
    color: #ffffff !important;
    border: 1px solid #4a5568 !important;
}

body.dark-theme .ui.modal .actions .button:hover {
    background-color: #4a5568 !important;
}

/* Ensure all text is readable in dark mode */
body.dark-theme,
body.dark-theme .ui.header,
body.dark-theme .ui.header .content,
body.dark-theme .ui.segment,
body.dark-theme .ui.message,
body.dark-theme .ui.list .item,
body.dark-theme .files-list .item {
    color: #ffffff !important;
}

/* Icon styles for dark mode */
body.dark-theme .ui.steps .step i.icon,
body.dark-theme .ui.header i.icon,
body.dark-theme .ui.form label i.icon,
body.dark-theme .ui.message i.icon,
body.dark-theme .ui.button i.icon,
body.dark-theme .ui.statistics i.icon,
body.dark-theme .ui.list i.icon,
body.dark-theme i.icon {
    color: #ffffff !important;
}

/* Specific icon colors */
body.dark-theme .ui.info.message i.icon {
    color: #63b3ed !important;
}

body.dark-theme .ui.header i.shield.alternate.icon {
    color: #4299e1 !important;
}

body.dark-theme .ui.steps .step i.icon {
    color: #4299e1 !important;
}

body.dark-theme .ui.check.circle.icon {
    color: #48bb78 !important;
}

/* Button icons should match button text */
body.dark-theme .ui.primary.button i.icon {
    color: #ffffff !important;
}

body.dark-theme .ui.teal.button i.icon {
    color: #ffffff !important;
}

body.dark-theme .ui.blue.button i.icon {
    color: #ffffff !important;
}

body.dark-theme .ui.olive.button i.icon {
    color: #ffffff !important;
}

/* Steps icons */
body.dark-theme .ui.steps .step {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-theme .ui.steps .step .title {
    color: #ffffff !important;
}

body.dark-theme .ui.steps .step .description {
    color: #a0aec0 !important;
} 