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

/* CSS Variables for themes */
:root {
    /* Light theme colors */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: rgba(0, 0, 0, 0.02);
    --bg-hover: rgba(0, 0, 0, 0.05);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #555;
    --border-primary: #ddd;
    --border-secondary: rgba(0, 0, 0, 0.1);
    --border-tertiary: rgba(0, 0, 0, 0.05);
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --loading-bg: #d1ecf1;
    --loading-text: #0c5460;
    --loading-border: #bee5eb;
    --copy-success: #28a745;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
}

/* Dark theme colors */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border-primary: #444444;
    --border-secondary: rgba(255, 255, 255, 0.1);
    --border-tertiary: rgba(255, 255, 255, 0.05);
    --primary-color: #8b9aff;
    --primary-hover: #7a8cff;
    --success-bg: #1e3a2e;
    --success-text: #4ade80;
    --success-border: #2d5a4d;
    --error-bg: #3a1e1e;
    --error-text: #f87171;
    --error-border: #5a2d2d;
    --loading-bg: #1e3a4a;
    --loading-text: #60a5fa;
    --loading-border: #2d5a7a;
    --copy-success: #4ade80;
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
}

.app {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
    transition: background var(--transition), box-shadow var(--transition);
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
    transition: color var(--transition);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    padding: 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

button:hover {
    background: var(--primary-hover);
}

button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

#result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

#result.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

#result.invalid {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

#result.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

#result.loading {
    background: var(--loading-bg);
    color: var(--loading-text);
    border: 1px solid var(--loading-border);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.status-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vat-row, .info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.label {
    font-weight: 600;
    min-width: 60px;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.vat-number {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.vat-number:hover {
    background-color: var(--bg-hover);
}

.vat-number.clickable {
    border-bottom: 1px dashed var(--text-secondary);
}

.info-text {
    flex: 1;
    line-height: 1.4;
}

.loading-text {
    text-align: center;
    font-style: italic;
}

.bic-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-secondary);
    transition: border-color var(--transition);
}

.bic-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
    transition: color var(--transition);
}

.bic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.bic-grid::-webkit-scrollbar {
    width: 6px;
}

.bic-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.bic-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

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

.bic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    transition: background-color var(--transition);
}

.bic-item:hover {
    background: var(--bg-hover);
}

.bank-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    flex: 1;
    margin-right: 1rem;
    transition: color var(--transition);
}

.bic-code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all var(--transition);
    border-bottom: 1px dashed var(--primary-color);
    white-space: nowrap;
}

.bic-code:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-hover);
}

.hidden {
    display: none;
}

/* Header with theme toggle */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform var(--transition);
}

.theme-toggle:hover .theme-icon {
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .app {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .header {
        margin-bottom: 1.5rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .theme-icon {
        font-size: 1rem;
    }
}