/* AI Arabic Dictionary Styles */

.aad-dictionary-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Search Section */
.aad-search-section {
    margin-bottom: 30px;
    text-align: center;
}

.aad-search-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.aad-search-input {
    flex: 1;
    min-width: 300px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.aad-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.aad-search-btn,
.aad-clear-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aad-search-btn {
    background-color: #0073aa;
    color: white;
}

.aad-search-btn:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.aad-clear-btn {
    background-color: #666;
    color: white;
}

.aad-clear-btn:hover {
    background-color: #555;
}

/* Loading Indicator */
.aad-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.aad-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.aad-results {
    margin-top: 30px;
}

.dictionary-result {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dictionary-result::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
}

.dictionary-result:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
    border-color: #0073aa;
}

.word-pair {
    text-align: center;
    margin-bottom: 16px;
}

.arabic-translation {
    font-size: 42px;
    font-weight: bold;
    color: #0073aa;
    direction: rtl;
    text-align: center;
    margin-bottom: 8px;
    font-family: "Amiri", "Scheherazade New", "Times New Roman", serif;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.english-word {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.definition {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    font-style: italic;
    background: rgba(0, 115, 170, 0.03);
    padding: 16px;
    border-radius: 8px;
    margin: 16px -4px 0 -4px;
}

/* Alphabet Navigation */
.aad-alphabet-nav {
    margin-bottom: 30px;
    text-align: center;
}

.aad-alphabet-nav h3 {
    margin-bottom: 15px;
    color: #333;
}

.aad-alphabet-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.aad-letter-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aad-letter-btn:hover {
    border-color: #0073aa;
    background-color: #0073aa;
    color: white;
    transform: scale(1.1);
}

/* Random Words Section */
.aad-random-words {
    margin-bottom: 30px;
}

.aad-random-words h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.aad-word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.aad-word-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease;
}

.aad-word-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.aad-word-item .aad-english {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.aad-word-item .aad-arabic {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    direction: rtl;
    font-family: "Amiri", "Times New Roman", serif;
    margin-bottom: 8px;
}

.aad-word-item .aad-definition {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Buttons */
.aad-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aad-btn-secondary {
    background-color: #6c757d;
    color: white;
    margin: 0 auto;
    display: block;
    width: fit-content;
}

.aad-btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

/* Instructions */
.aad-instructions {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 20px;
    border-radius: 0 8px 8px 0;
}

.aad-instructions h3 {
    margin-top: 0;
    color: #0073aa;
}

.aad-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.aad-instructions li {
    margin-bottom: 8px;
    color: #555;
}

/* No Results */
.aad-no-results {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.aad-no-results h3 {
    margin-top: 0;
    color: #856404;
}

/* Error Messages */
.aad-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aad-dictionary-container {
        padding: 15px;
    }
    
    .aad-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aad-search-input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .aad-alphabet-letters {
        gap: 4px;
    }
    
    .aad-letter-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .aad-word-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .arabic-translation {
        font-size: 32px;
    }
    
    .english-word {
        font-size: 24px;
    }
    
    .dictionary-result {
        padding: 20px 16px;
        margin-bottom: 16px;
    }
    
    .definition {
        font-size: 15px;
        margin: 12px -2px 0 -2px;
        padding: 12px;
    }
}

/* Add enhanced visual effects */
@media (min-width: 769px) {
    .dictionary-result {
        margin-bottom: 25px;
    }
    
    .dictionary-result:hover .arabic-translation {
        color: #005a87;
        transform: scale(1.02);
    }
    
    .dictionary-result:hover .english-word {
        color: #0073aa;
        transform: scale(1.02);
    }
}

/* Add subtle animations */
.arabic-translation,
.english-word {
    transition: all 0.3s ease;
}

/* Admin Styles */
.wp-admin .aad-dictionary-container {
    max-width: none;
}

/* RTL Support */
[dir="rtl"] .aad-search-form {
    direction: rtl;
}

[dir="rtl"] .aad-word-item .aad-arabic {
    text-align: right;
}

/* RTL Support */
[dir="rtl"] .aad-search-form {
    direction: rtl;
}

[dir="rtl"] .aad-word-item .aad-arabic {
    text-align: right;
}