/* Shared CSS Styles for Russian to English Translator Application */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: white;
    font-size: 2.5em;
    font-weight: 300;
    margin-bottom: 10px;
}

.header .subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1em;
}

.navigation {
    display: flex;
    background: white;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    margin-bottom: 0;
}

.nav-tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-tab.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.nav-tab:hover:not(.active) {
    background: #e9ecef;
}

.container {
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    min-height: 500px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

h2 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
    font-weight: 300;
}

.page-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

input[type="file"] {
    width: 100%;
    padding: 15px;
    border: 2px dashed #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

input[type="file"]:hover {
    border-color: #667eea;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-success:hover {
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.result {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: none;
}

.result h3 {
    color: #333;
    margin-bottom: 10px;
}

.result-text {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
}

.loading {
    display: none;
    text-align: center;
    color: #667eea;
    margin: 20px 0;
}

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

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

.error {
    background: #ffe6e6;
    border-left-color: #ff6b6b;
    color: #d63031;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 5px;
    font-size: 0.9em;
    color: #666;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.modal-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-body {
    padding: 30px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    background: #f8f9fa;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-meta-item {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    color: #666;
}

.modal-content-text {
    line-height: 1.7;
    font-size: 1.1em;
    color: #333;
}

.edit-mode {
    display: none;
}

.edit-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

.edit-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    min-height: 150px;
    resize: vertical;
}

.translate-action {
    margin-top: 10px;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.instruction-note {
    color: #666;
    font-size: 0.9em;
}

.instruction-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #666;
}

.publish-action {
    margin-top: 20px;
    text-align: center;
}

.publish-btn {
    display: none;
    max-width: 200px;
}

/* Upload Tabs */
.upload-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    margin-bottom: 20px;
}

.upload-tab {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    background: #e9ecef;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.upload-tab.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.upload-tab:hover:not(.active) {
    background: #dee2e6;
}

.upload-section {
    margin-bottom: 20px;
}

.youtube-info {
    margin-top: 15px;
}

.youtube-info .file-info {
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.edit-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Search Section Styles */
.search-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.search-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.search-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.articles-grid {
    display: grid;
    gap: 20px;
}

.article-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Article Card Styles */
.article-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.published-date, .source {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
}

.article-preview {
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
}

.delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #dc3545;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #dc3545;
    color: white;
}

.read-full-btn {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    transition: color 0.3s ease;
}

.read-full-btn:hover {
    color: #764ba2;
}

/* Modal Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar styling for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}