:root {
    --bg-gradient-start: #ffffff;
    --bg-gradient-end: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-light: #202124;
    --text-light-secondary: #5f6368;
    --accent-color: #8ab4f8;
    --accent-gradient-start: #4285f4;
    --accent-gradient-end: #34a853;
    --surface-bg: #ffffff;
    --surface-bg-secondary: #f8f9fa;
    --border-color: #dfe1e5;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --logo-icon-color: #4285f4;
    --link-color: #1a0dab;
    --link-color-visited: #609;
    --error-color: #d93025;
    --card-bg: #f8f9fa;
    --card-border: #e9ecef;
    --card-text: #202124;
}

body[data-theme="dark"] {
    --bg-gradient-start: #1e202a;
    --bg-gradient-end: #2a2c3a;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-light: #f0f0f0;
    --text-light-secondary: rgba(240, 240, 240, 0.8);
    --accent-color: #7e57c2;
    --accent-gradient-start: #7e57c2;
    --accent-gradient-end: #512da8;
    --surface-bg: #2c2f3b;
    --surface-bg-secondary: #353846;
    --border-color: #404452;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --logo-icon-color: #7e57c2;
    --link-color: #8c9eff;
    --link-color-visited: #9ccc65;
    --error-color: #ef5350;
    --card-bg: #23232b;
    --card-border: #353846;
    --card-text: #f0f0f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--surface-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    font-size: 28px;
    color: var(--logo-icon-color);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: #f8f9fa;
}

body[data-theme="dark"] .nav-link:hover,
body[data-theme="dark"] .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
}

.theme-toggle-checkbox {
    display: none;
}

.theme-toggle-label {
    position: relative;
    display: block;
    width: 56px;
    height: 28px;
    background: #d1d1d1;
    border-radius: 28px;
    cursor: pointer;
}

.theme-toggle-ball {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: transform 0.3s cubic-bezier(.4,2,.6,1), background 0.3s;
    z-index: 2;
}

.theme-toggle-label .fa-moon,
.theme-toggle-label .fa-sun {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 3;
    pointer-events: none;
    transition: color 0.3s, opacity 0.3s;
}

.theme-toggle-label .fa-moon {
    right: 8px;
    color: #6c63ff;
    opacity: 0.5;
}

.theme-toggle-label .fa-sun {
    left: 8px;
    color: #ffd600;
    opacity: 0.5;
}

.theme-toggle-checkbox:not(:checked) + .theme-toggle-label .fa-sun {
    opacity: 1;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .fa-moon {
    opacity: 1;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-ball {
    transform: translateX(28px);
    background: #23232b;
}

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 0;
    flex-grow: 1;
}

/* Weather container */
.weather-container {
    padding: 12px 20px;
    margin-top: 15px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    color: var(--card-text);
    width: auto;
    max-width: 300px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.weather-container:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.weather-container img {
    width: 32px;
    height: 32px;
}

.weather-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.weather-icon {
    width: 32px;
    height: 32px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-temp {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--card-text);
}

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

.weather-error {
    color: var(--error-color);
    font-size: 0.9rem;
    margin: 0;
}

/* Search container */
.search-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    background: var(--surface-bg);
    border-radius: 50px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 15px 40px var(--shadow-color);
    transform: translateY(-2px);
}

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

.search-input {
    width: 100%;
    padding: 18px 50px 18px 50px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: none;
}

.clear-btn:hover {
    background: var(--surface-bg-secondary);
    color: var(--text-primary);
}

.clear-btn.visible {
    display: block;
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
    color: var(--text-light);
    border: none;
    padding: 18px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.search-btn:active {
    transform: translateY(0);
}

/* Search suggestions */
.search-suggestions {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--card-text);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.suggestion-item:hover {
    background: #e9ecef;
    color: var(--card-text);
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

.suggestion-item i {
    font-size: 14px;
    opacity: 0.7;
}

.suggestion-item-recent {
    position: relative;
}

.suggestion-item-recent span {
    flex: 1;
}

.suggestion-remove {
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    opacity: 0.4;
    color: inherit;
    border-radius: 4px;
}

.suggestion-remove:hover {
    opacity: 1;
    background: rgba(0,0,0,0.08);
}

/* Results container */
.results-container {
    width: 100%;
    max-width: 800px;
    background: var(--surface-bg);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow-color);
    overflow: hidden;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.results-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-bg-secondary);
}

.results-info {
    font-weight: 600;
    color: var(--text-secondary);
}

.results-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    color: var(--text-light);
    border-color: var(--accent-color);
}

/* Results list */
.results-list {
    padding: 20px 30px;
}

.result-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    margin-bottom: 18px;
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s cubic-bezier(.4,2,.6,1) forwards;
    overflow: hidden;
    max-width: 100%;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: none;
    }
}

.result-content {
    min-width: 0;
    flex: 1 1 0%;
}

.result-title, .result-url, .result-snippet {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    max-width: 100%;
}

.result-snippet {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: var(--surface-bg-secondary);
}

.result-item:hover {
    background: var(--surface-bg-secondary);
    margin: 0 -30px;
    padding: 20px 30px;
}

.result-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.result-title:hover {
    color: var(--accent-color);
}

.result-url {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 6px;
    word-break: break-all;
}

.result-snippet {
    color: var(--text-primary);
    font-size: 0.98rem;
    margin-top: 2px;
}

.result-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.result-image-container {
    width: 100%;
}

.result-image-large {
    max-width: 100%;
    border-radius: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.pagination-btn:hover {
    background: var(--accent-color);
    color: var(--text-light);
    border-color: var(--accent-color);
}

.pagination-btn.active {
    background: var(--accent-color);
    color: var(--text-light);
    border-color: var(--accent-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--text-light-secondary);
    border-top: 4px solid var(--text-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
    text-align: center;
}

.error-message i {
    font-size: 48px;
    color: var(--error-color);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 30px 0;
    color: var(--text-light-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-light-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-light);
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .nav {
        gap: 15px;
        order: 1;
    }
    
    .theme-switcher {
        order: 2;
    }
    
    .search-box {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .results-filters {
        flex-wrap: wrap;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .search-input {
        padding: 15px 45px 15px 45px;
        font-size: 16px;
    }
    
    .search-btn {
        padding: 15px 25px;
    }
    
    .results-header {
        padding: 15px 20px;
    }
    
    .results-list {
        padding: 15px 20px;
    }
    
    .pagination {
        padding: 15px 20px;
    }
}

/* Image Grid Layout */
.results-list.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding-top: 20px;
}

.image-result-item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-bg-secondary);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.image-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow-color);
}

.image-result-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-result-item .image-title {
    padding: 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-row {
    display: flex;
    gap: 32px;
    margin-top: 24px;
}

.weather-widget, .currency-widget {
    flex: 1 1 0%;
    background: var(--card-bg, #f8f9fa);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 28px 36px;
    min-width: 0;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-size: 1.1rem;
    font-weight: 500;
}

.currency-widget {
    gap: 14px;
}

.currency-rate {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.currency-rate .currency-symbol {
    font-size: 1.3rem;
    margin-right: 6px;
}

.currency-rate .currency-label {
    color: var(--text-secondary, #888);
    font-size: 0.98rem;
    margin-left: 6px;
}

@media (max-width: 900px) {
    .info-row {
        flex-direction: column;
        gap: 16px;
    }
    .weather-widget, .currency-widget {
        width: 100%;
        min-width: 0;
        padding: 18px 16px;
    }
} 