/* 
 * World-Style CSS for English to Urdu Translation
 * Based on the styling from world-newspapers/regions.php
 */

/* Base Styles */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #cfe2ff;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --urdu-font: 'Noto Nastaliq Urdu', serif;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f5f7fa;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a202c;
}

.urdu-text {
    font-family: var(--urdu-font);
    line-height: 2;
    text-align: right;
    direction: rtl;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6, #1e40af);
    color: white;
    padding: 4rem 0;
    border-radius: 1rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/dictionary-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Search Form */
.search-form-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.search-form .form-control {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 0.5rem 0 0 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
    color: white;
}

.search-form .btn {
    padding: 1rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-form .btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Search Suggestions */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.suggestions-box.show {
    display: block;
}

.suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestion-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.suggestion-list li:last-child {
    border-bottom: none;
}

.suggestion-list li:hover,
.suggestion-list li.selected {
    background-color: #f8f9fa;
}

/* Keyboard Keys */
.keyboard-key {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    color: #495057;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    margin: 0 0.2rem;
}

/* Word of the Day */
.word-of-day {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.word-of-day-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.word-of-day-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.word-of-day-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.word-of-day-content {
    display: flex;
    flex-wrap: wrap;
}

.word-of-day-english {
    flex: 1 1 100%;
    margin-bottom: 1rem;
}

.word-of-day-english h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.word-of-day-english .pronunciation {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    margin-left: 0.5rem;
}

.word-of-day-english .part-of-speech {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
    background-color: #dbeafe;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.word-of-day-urdu {
    flex: 1 1 100%;
    margin-bottom: 1rem;
}

.word-of-day-urdu h4 {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.word-of-day-urdu p {
    font-family: var(--urdu-font);
    font-size: 1.5rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
    margin: 0;
}

.word-of-day-definition {
    flex: 1 1 100%;
    margin-bottom: 1rem;
}

.word-of-day-definition h4 {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.word-of-day-example {
    flex: 1 1 100%;
}

.word-of-day-example h4 {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.word-of-day-example p {
    font-style: italic;
    color: #4b5563;
    margin: 0;
}

/* Feature Cards */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.25rem;
}

.feature-card-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.feature-card-icon.green {
    background: linear-gradient(135deg, #10b981, #047857);
}

.feature-card-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.feature-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.feature-card-text {
    color: #4b5563;
    margin: 0;
}

/* Word Entry */
.word-entry {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.word-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1a202c;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.word-pronunciation {
    font-size: 1rem;
    color: #6c757d;
    font-style: italic;
    margin-left: 0.5rem;
}

.word-part-of-speech {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
    background-color: #dbeafe;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.word-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.word-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.word-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a202c;
}

.word-urdu {
    font-family: var(--urdu-font);
    font-size: 1.5rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
    margin-bottom: 1rem;
}

.word-definition {
    margin-bottom: 1rem;
}

.word-examples {
    list-style: none;
    padding: 0;
    margin: 0;
}

.word-examples li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.word-examples li:before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
}

.word-examples li:last-child {
    margin-bottom: 0;
}

.word-synonyms,
.word-antonyms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.word-tag:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .search-form .form-control,
    .search-form .btn {
        padding: 0.75rem 1rem;
    }
    
    .word-of-day-content {
        flex-direction: column;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #1a202c;
    color: #e2e8f0;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
    color: #f7fafc;
}

.dark-mode .word-of-day,
.dark-mode .feature-card,
.dark-mode .word-entry {
    background-color: #2d3748;
    border-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .word-of-day-title,
.dark-mode .feature-card-title,
.dark-mode .word-title,
.dark-mode .word-section-title {
    color: #f7fafc;
}

.dark-mode .word-of-day-english .pronunciation,
.dark-mode .word-pronunciation {
    color: #a0aec0;
}

.dark-mode .word-of-day-definition h4,
.dark-mode .word-of-day-example h4,
.dark-mode .word-of-day-urdu h4 {
    color: #cbd5e0;
}

.dark-mode .feature-card-text,
.dark-mode .word-definition,
.dark-mode .word-examples li {
    color: #a0aec0;
}

.dark-mode .word-tag {
    background-color: #4a5568;
    color: #e2e8f0;
}

.dark-mode .word-tag:hover {
    background-color: #2d3748;
    color: #f7fafc;
}

.dark-mode .suggestions-box {
    background-color: #2d3748;
    border-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .suggestion-list li {
    border-bottom-color: #4a5568;
}

.dark-mode .suggestion-list li:hover,
.dark-mode .suggestion-list li.selected {
    background-color: #4a5568;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
