/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode (Primary) */
.dark-mode {
    background-color: #000000;
    color: #ffffff;
}

/* Light Mode (Secondary) */
.light-mode {
    background-color: #f5f5f0;
    color: #1a1a1a;
}

.light-mode h1, .light-mode h2, .light-mode h3 {
    color: #1a3d2e;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: transparent;
    padding: 1.5rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.wordmark {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.dark-mode .wordmark {
    color: #ffffff;
}

.light-mode .wordmark {
    color: #1a3d2e;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

.dark-mode .lang-btn {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .lang-btn {
    color: rgba(26, 61, 46, 0.6);
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    font-weight: 500;
}

.dark-mode .lang-btn.active {
    color: #ffffff;
}

.light-mode .lang-btn.active {
    color: #1a3d2e;
}

.lang-separator {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

.dark-mode .lang-separator {
    color: rgba(255, 255, 255, 0.3);
}

.light-mode .lang-separator {
    color: rgba(26, 61, 46, 0.3);
}

/* Mode Toggle */
.mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: opacity 0.2s ease;
}

.mode-toggle:hover {
    opacity: 0.7;
}

.toggle-icon {
    display: block;
}

/* Word Search Section */
.word-search-section {
    padding: 3rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-container {
    text-align: center;
}

/* Search Language Selector */
.search-language-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-lang-btn {
    background: none;
    border: 1px solid;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    transition: all 0.2s ease;
    font-family: inherit;
    border-radius: 4px;
}

.dark-mode .search-lang-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .search-lang-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .search-lang-btn.active {
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.light-mode .search-lang-btn {
    border-color: rgba(26, 61, 46, 0.2);
    color: rgba(26, 61, 46, 0.6);
    background-color: rgba(255, 255, 255, 0.8);
}

.light-mode .search-lang-btn:hover {
    border-color: rgba(26, 61, 46, 0.4);
    color: rgba(26, 61, 46, 0.8);
    background-color: rgba(255, 255, 255, 1);
}

.light-mode .search-lang-btn.active {
    border-color: rgba(26, 61, 46, 0.6);
    color: #1a3d2e;
    background-color: rgba(26, 61, 46, 0.1);
    font-weight: 500;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    border: 1px solid;
    border-radius: 0;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.dark-mode .search-input {
    background-color: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.dark-mode .search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.light-mode .search-input {
    background-color: #ffffff;
    border-color: rgba(26, 61, 46, 0.2);
    color: #1a1a1a;
}

.light-mode .search-input:focus {
    outline: none;
    border-color: rgba(26, 61, 46, 0.5);
}

.search-helper {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.dark-mode .search-helper {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .search-helper {
    color: rgba(26, 61, 46, 0.7);
}

/* Suggestions Container */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    z-index: 50;
    text-align: left;
    padding-top: 1rem;
}

.suggestions-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding: 0 1.5rem;
}

.dark-mode .suggestions-label {
    color: rgba(255, 255, 255, 0.5);
}

.light-mode .suggestions-label {
    color: rgba(26, 61, 46, 0.5);
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.5rem 1.5rem;
}

.suggestion-chip {
    background: none;
    border: 1px solid;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 20px;
    white-space: nowrap;
}

.dark-mode .suggestion-chip {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .suggestion-chip:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.light-mode .suggestion-chip {
    border-color: rgba(26, 61, 46, 0.3);
    color: rgba(26, 61, 46, 0.8);
    background-color: rgba(255, 255, 255, 0.8);
}

.light-mode .suggestion-chip:hover {
    border-color: rgba(26, 61, 46, 0.6);
    color: #1a3d2e;
    background-color: rgba(255, 255, 255, 1);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.hero-default,
.hero-result {
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: #ffffff;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-phonetics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.hero-phonetic-latin {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.01em;
}

.hero-phonetic-ipa {
    font-size: clamp(0.875rem, 1.75vw, 1.125rem);
    font-weight: 400;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.01em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.01em;
}

/* Hero Result Styles */
.hero-result {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.hero-result-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.hero-result-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.hero-result-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

.hero-result-value {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: #ffffff;
    line-height: 1.6;
    text-align: center;
}

/* Description Section */
.description-section {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.description-text {
    font-size: 1.125rem;
    line-height: 1.8;
}

.dark-mode .description-text {
    color: rgba(255, 255, 255, 0.8);
}

.light-mode .description-text {
    color: rgba(26, 61, 46, 0.8);
}

/* Word of the Day Section */
.word-of-day-section {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.word-card {
    padding: 2rem;
    border: 1px solid;
    transition: border-color 0.2s ease;
}

.dark-mode .word-card {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.02);
}

.light-mode .word-card {
    border-color: rgba(26, 61, 46, 0.2);
    background-color: rgba(255, 255, 255, 0.8);
}

.word-card-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.dark-mode .word-card-title {
    color: #ffffff;
}

.light-mode .word-card-title {
    color: #1a3d2e;
}

.word-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.word-card-row {
    display: flex;
    gap: 1rem;
}

.word-card-label {
    font-weight: 500;
    min-width: 80px;
    font-size: 0.9rem;
}

.dark-mode .word-card-label {
    color: rgba(255, 255, 255, 0.7);
}

.light-mode .word-card-label {
    color: rgba(26, 61, 46, 0.7);
}

.word-card-value {
    flex: 1;
}

/* Results Section */
.results-section {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.result-container {
    padding: 2rem 0;
}

.result-word {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 2rem;
    color: #ffffff;
}

.dark-mode .result-word {
    color: #ffffff;
}

.light-mode .result-word {
    color: #1a3d2e;
}

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

.result-row {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid;
}

.dark-mode .result-row {
    border-color: rgba(255, 255, 255, 0.1);
}

.light-mode .result-row {
    border-color: rgba(26, 61, 46, 0.1);
}

.result-label {
    font-weight: 600;
    min-width: 100px;
    font-size: 1rem;
}

.dark-mode .result-label {
    color: rgba(255, 255, 255, 0.8);
}

.light-mode .result-label {
    color: rgba(26, 61, 46, 0.8);
}

.result-value {
    flex: 1;
    font-size: 1rem;
    line-height: 1.6;
}

.result-etymology {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.7;
}

.dark-mode .result-etymology {
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .result-etymology {
    color: rgba(26, 61, 46, 0.6);
    border-top: 1px solid rgba(26, 61, 46, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-controls {
        gap: 1rem;
    }

    .word-search-section,
    .description-section,
    .results-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-section {
        min-height: 50vh;
    }
}
