:root {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #333;
    --text-secondary: #666;
    --text-white: #fff;
    --border-color: #eee;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --accent-color: #667eea;
    --hover-color: #764ba2;
    --success-color: #52c41a;
    --error-color: #ff4d4f;
}

[data-theme="dark"] {
    --card-bg: rgba(30, 30, 30, 0.95);
    --text-primary: #fff;
    --text-secondary: #aaa;
    --border-color: #333;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --accent-color: #764ba2;
}

[data-theme="eye-care"] {
    --bg-primary: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --card-bg: rgba(255, 255, 250, 0.95);
    --text-primary: #333;
    --text-secondary: #555;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    background: var(--bg-primary);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1 { color: var(--text-white); font-size: 28px; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

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

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    gap: 20px;
    z-index: 100;
}

.sidebar-item {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255,255,255,0.8);
}

.sidebar-item:hover { background: rgba(255,255,255,0.2); color: white; }

.sidebar-item.active { background: rgba(255,255,255,0.3); color: white; }

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-right { display: flex; align-items: center; gap: 15px; }

.theme-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--text-white);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.theme-btn:hover { background: rgba(255,255,255,0.3); }

.user-info { display: flex; align-items: center; gap: 10px; color: var(--text-white); }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.auth-btns { display: flex; gap: 10px; }

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary { background: var(--text-white); color: var(--accent-color); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-outline {
    background: transparent;
    color: var(--text-white);
    border: 1px solid rgba(255,255,255,0.5);
}

.btn-outline:hover { background: rgba(255,255,255,0.1); }

.search-section { text-align: center; margin-bottom: 40px; }

.search-box {
    max-width: 600px;
    margin: 0 auto 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 45px 14px 20px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.search-input:focus { outline: none; box-shadow: 0 4px 25px rgba(0,0,0,0.15); }

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

.search-btn:hover { background: var(--hover-color); }

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.engine-tag {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.engine-tag.active { background: rgba(255,255,255,0.4); }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-overlay.show .modal { transform: translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title { font-size: 20px; font-weight: 600; color: var(--text-primary); }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
}

.form-input:focus { outline: none; border-color: var(--accent-color); }

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    line-height: 1;
    color: var(--text-secondary);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.form-error { color: var(--error-color); font-size: 12px; margin-top: 5px; }

.form-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.form-submit:hover { background: var(--hover-color); }

.form-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-switch a { color: var(--accent-color); text-decoration: none; }
.form-switch a:hover { text-decoration: underline; }

.loading { text-align: center; color: var(--text-white); padding: 50px; }

.empty-state { text-align: center; color: var(--text-secondary); padding: 40px; }

.empty-state-icon { font-size: 48px; margin-bottom: 15px; }

@media (max-width: 768px) {
    .sidebar { width: 50px; }
    .container { padding-left: 60px; }
}
