:root {
    /* Light Theme Colors */
    --bg-gradient: linear-gradient(135deg, #dfd5ff 0%, #a3cfff 100%);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --input-bg: #ffffff;
    --btn-primary: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    --btn-hover: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    --item-bg: rgba(255, 255, 255, 0.8);
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-gradient: linear-gradient(135deg, #1f1c2c 0%, #0c1a2e 100%);
    --glass-bg: rgba(20, 20, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.8);
    --item-bg: rgba(30, 41, 59, 0.8);
    --border-color: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Top Navigation */
.top-bar {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: flex-end;
    padding: 10px 0;
}

.nav-links button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
}

.nav-links button:hover {
    opacity: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    margin: 40px 0;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
}

.primary-btn {
    background: var(--btn-primary);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

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

/* Glass Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 1000px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* Form Elements */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input[type="text"], select {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

input[type="text"]:focus, select:focus {
    border-color: #4facfe;
}

.row-group {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
    min-width: 200px;
}

.style-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex: 2;
    padding-top: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.length-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.label-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.secondary-generate-btn {
    background: linear-gradient(135deg, #8782d4, #667eea);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 25px 0;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    padding-left: 35px;
    width: 250px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    background: var(--item-bg);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.4s ease forwards;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-icon {
    font-size: 1.2rem;
}

.result-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.result-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-actions button {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.9rem;
}

.result-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.result-actions .fav-btn.active {
    color: #ff4757;
    border-color: #ff4757;
}

/* Toast */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

.loader {
    border: 3px solid var(--border-color);
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}
@keyframes fadeout {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .row-group, .controls-row, .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    .hero h1 { font-size: 2.2rem; }
    .search-box input { width: 100%; }
    .result-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .result-actions { width: 100%; display: flex; justify-content: flex-end; }
}
