/* POLYGLOTIX Styles */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #f8fafc;
    --bg-dark: #1e293b;
    --text-light: #1f2937;
    --text-dark: #f1f5f9;
    --border-light: #e2e8f0;
    --border-dark: #334155;
    --card-light: #ffffff;
    --card-dark: #0f172a;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: var(--bg-dark);
    --text-color: var(--text-dark);
    --border-color: var(--border-dark);
    --card-bg: var(--card-dark);
}

[data-theme="light"] {
    --bg-color: var(--bg-light);
    --text-color: var(--text-light);
    --border-color: var(--border-light);
    --card-bg: var(--card-light);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

nav a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

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

.btn-login {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white !important;
    padding: 0.6rem 1.5rem !important;
    border-radius: 8px;
    font-weight: 600;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin: 2rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.phrase-card {
    border: 2px solid var(--border-color);
}

.phrase-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
}

.phrase-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1rem 0;
}

.phrase-translation {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
}

.phrase-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Level Tabs */
.level-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.level-tab {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.level-tab:hover {
    border-color: var(--primary-color);
}

.level-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.level-tab.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Language Selector */
.language-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.language-option {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.language-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.language-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #3b82f6;
}

/* Footer */
footer {
    background: var(--card-bg);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .phrase-controls {
        flex-direction: column;
    }
    
    .language-selector {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none; }
.flex { display: flex; }
.gap-1 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }