/* translator/static/translator/css/style.css */

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

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    font-weight: 300;
}

/* Search Section */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.input-row {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
    color: #6c757d;
}

.input-helper {
    margin-top: 5px;
}

.input-helper small {
    color: #6c757d;
    font-size: 12px;
}

/* Search Controls */
.search-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin-left: 8px;
    background: #e9ecef;
    color: #495057;
}

.btn-small:hover {
    background: #dee2e6;
}

.search-stats {
    color: #6c757d;
    font-size: 14px;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Results Section */
.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.results-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#results-count {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Result Item Styles */
.result-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.result-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-translation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
}

.translation-column {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.translation-column strong {
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 10px;
}

.language-text {
    font-size: 1.2em;
    margin: 10px 0;
    font-weight: 500;
    color: #2d3748;
}

/* Custom Audio Button Styles */
.custom-audio-btn {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #e1e5e9;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-audio-btn:hover {
    background: #e9ecef;
    color: #5a6fd8;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.custom-audio-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-audio-btn.playing {
    background: #667eea;
    color: white;
    border-color: #667eea;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Audio Player Container */
.audio-player {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Examples Section */
.examples-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.examples-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.examples-section h4::before {
    content: "💬";
    font-size: 1.2em;
}

.example-item {
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 3px solid #28a745;
    transition: all 0.3s ease;
}

.example-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.example-english {
    color: #495057;
    font-style: italic;
    margin-bottom: 8px;
    font-size: 15px;
}

.example-english::before {
    content: "🇺🇸 ";
    margin-right: 5px;
}

.example-turkmen {
    color: #28a745;
    font-style: italic;
    font-size: 15px;
}

.example-turkmen::before {
    content: "🇹🇲 ";
    margin-right: 5px;
}

/* Message Styles */
.info-message,
.warning-message {
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.info-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 1px solid #90caf9;
}

.warning-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffc107;
}

.welcome-content h3 {
    margin-bottom: 15px;
    font-size: 1.5em;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.feature-icon {
    font-size: 1.2em;
}

.no-results-content h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
}

.suggestions {
    margin-top: 20px;
    text-align: left;
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 10px;
}

.suggestions h4 {
    margin-bottom: 10px;
    color: #333;
}

.suggestions ul {
    list-style-position: inside;
    line-height: 1.8;
}

/* Footer Styles */
.footer {
    margin-top: 50px;
    padding-top: 30px;
}

.footer hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin-bottom: 20px;
}

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

.stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.stats-icon {
    font-size: 1.2em;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #764ba2;
}

.separator {
    color: #dee2e6;
}

.copyright {
    color: #6c757d;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .input-row {
        flex-direction: column;
        gap: 20px;
    }

    .main-translation {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .results-info {
        width: 100%;
        justify-content: space-between;
    }

    .search-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.7em;
    }

    .search-section {
        padding: 20px;
    }

    .result-item {
        padding: 20px;
    }

    .translation-column {
        padding: 15px;
    }

    .language-text {
        font-size: 1.1em;
    }
}

/* Animation for results */
.result-item {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Print styles */
@media print {

    .search-controls,
    .back-to-top,
    .footer-links {
        display: none;
    }

    .result-item {
        break-inside: avoid;
        margin-bottom: 20px;
    }

    body {
        background: white;
    }

    .header {
        background: #333 !important;
        color: white !important;
    }
}