/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    font-size: 16px;
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 80px);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-bottom: 2px solid #8B4513;
}

.header-content {
    text-align: center;
    flex: 1;
}

.title {
    font-size: 2.5rem;
    color: #8B4513;
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

/* Search section */
.search-section {
    margin-bottom: 3rem;
}

.search-form {
    display: flex;
    justify-content: center;
}

.search-input-group {
    display: flex;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-right: none;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #8B4513;
}

.search-button {
    padding: 1rem 1.5rem;
    background-color: #8B4513;
    color: white;
    border: 2px solid #8B4513;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #A0522D;
    border-color: #A0522D;
}

.search-button:active {
    background-color: #654321;
    border-color: #654321;
}

/* Results section */
.results-section {
    min-height: 300px;
}

.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #666;
}

.error {
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.error-text {
    color: #c33;
    font-weight: bold;
}

.results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.results-title {
    font-size: 1.5rem;
    color: #8B4513;
    margin-bottom: 0.25rem;
}

.results-count {
    color: #666;
    font-size: 0.9rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    position: relative;
}

.result-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-word {
    font-size: 1.25rem;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.75rem;
    text-transform: capitalize;
}

.result-definition {
    line-height: 1.7;
    color: #444;
}

.result-definition p {
    margin-bottom: 0.5rem;
}

.result-definition p:last-child {
    margin-bottom: 0;
}

.result-buttons {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.copy-button,
.share-button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: white;
}

.copy-button:hover,
.share-button:hover {
    border-color: #8B4513;
    background-color: #f9f9f9;
    transform: scale(1.1);
}

.copy-button:active,
.share-button:active {
    transform: scale(0.95);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-results .suggestion {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 0.9rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid #8B4513;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: white;
}

.theme-toggle:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.theme-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg);
}

/* Dark Mode Styles */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

[data-theme="dark"] .header {
    border-bottom-color: #D2691E;
}

[data-theme="dark"] .title {
    color: #D2691E;
    text-shadow: 1px 1px 2px rgba(210, 105, 30, 0.1);
}

[data-theme="dark"] .subtitle {
    color: #b0b0b0;
}

[data-theme="dark"] .search-input {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .search-input:focus {
    border-color: #D2691E;
}

[data-theme="dark"] .search-input::placeholder {
    color: #888;
}

[data-theme="dark"] .search-button {
    background-color: #D2691E;
    border-color: #D2691E;
}

[data-theme="dark"] .search-button:hover {
    background-color: #FF8C00;
    border-color: #FF8C00;
}

[data-theme="dark"] .search-button:active {
    background-color: #B8860B;
    border-color: #B8860B;
}

[data-theme="dark"] .theme-toggle {
    border-color: #D2691E;
    background-color: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: #3d3d3d;
}

[data-theme="dark"] .loading {
    color: #b0b0b0;
}

[data-theme="dark"] .error {
    background-color: #3d1a1a;
    border-color: #661a1a;
}

[data-theme="dark"] .error-text {
    color: #ff6b6b;
}

[data-theme="dark"] .results-header {
    border-bottom-color: #444;
}

[data-theme="dark"] .results-title {
    color: #D2691E;
}

[data-theme="dark"] .results-count {
    color: #b0b0b0;
}

[data-theme="dark"] .result-item {
    background-color: #2d2d2d;
    border-color: #444;
}

[data-theme="dark"] .result-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .result-word {
    color: #D2691E;
}

[data-theme="dark"] .result-definition {
    color: #d0d0d0;
}

[data-theme="dark"] .copy-button,
[data-theme="dark"] .share-button {
    border-color: #555;
    background-color: #2d2d2d;
}

[data-theme="dark"] .copy-button:hover,
[data-theme="dark"] .share-button:hover {
    border-color: #D2691E;
    background-color: #3d3d3d;
}

[data-theme="dark"] .no-results {
    color: #b0b0b0;
}

[data-theme="dark"] .footer {
    border-top-color: #444;
    color: #b0b0b0;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .theme-toggle {
        align-self: center;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 4px;
    }
    
    .search-input {
        border-right: 2px solid #ddd;
        border-bottom: 1px solid #ddd;
        border-radius: 4px 4px 0 0;
    }
    
    .search-button {
        border-top: none;
        border-radius: 0 0 4px 4px;
    }
    
    .result-item {
        padding: 1rem;
    }
    
    .result-word {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem 0.5rem;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .header {
        margin-bottom: 2rem;
        padding: 1.5rem 0;
    }
    
    .search-section {
        margin-bottom: 2rem;
    }
    
    .search-input, .search-button {
        padding: 0.875rem 1rem;
    }
}