/**
 * Translation Manager Pro - Main CSS Styles
 * WordPress plugin styling with modern design
 */

/* Reset and base styles */
.tmp-main-app * {
    box-sizing: border-box;
}

.tmp-main-app {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tmp-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Header styles */
.tmp-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tmp-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.tmp-header p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Navigation tabs */
.tmp-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}

.tmp-tab-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tmp-tab-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tmp-tab-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Tab content */
.tmp-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tmp-tab-content.active {
    display: block;
}

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

/* Form elements */
.tmp-form-group {
    margin-bottom: 20px;
}

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

.tmp-select,
.tmp-input,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.tmp-select:focus,
.tmp-input:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Buttons */
.tmp-btn-primary,
.tmp-btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.tmp-btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.tmp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

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

.tmp-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.tmp-btn-primary:disabled,
.tmp-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Translation specific styles */
.tmp-translation-form {
    display: grid;
    gap: 20px;
}

.tmp-translation-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
}

.tmp-input-section,
.tmp-output-section {
    min-height: 200px;
}

.tmp-translate-btn-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.tmp-result-box {
    min-height: 120px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #6c757d;
    overflow-wrap: break-word;
}

.tmp-result-box:not(:empty) {
    background: white;
    border-color: #28a745;
    color: #333;
}

.tmp-char-count {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.tmp-result-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

.tmp-result-meta span {
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Voice translator styles */
.tmp-voice-container {
    text-align: center;
    padding: 40px 20px;
}

.tmp-voice-controls {
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.tmp-voice-result {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
    text-align: left;
}

.tmp-voice-result h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 16px;
}

.tmp-voice-result p {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Mind detector styles */
.tmp-mind-detector-container {
    max-width: 800px;
    margin: 0 auto;
}

.tmp-context-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.tmp-advice-input {
    margin-bottom: 30px;
}

.tmp-advice-input textarea {
    min-height: 120px;
    margin-bottom: 15px;
}

.tmp-advice-result {
    background: white;
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.tmp-advice-result h4,
.tmp-advice-result h5 {
    color: #495057;
    margin-bottom: 15px;
}

.tmp-advice-result #advice-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.advice-suggestions ul {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.advice-suggestions li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.advice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Projects and invoices styles */
.tmp-projects-container,
.tmp-invoices-container {
    max-width: 900px;
    margin: 0 auto;
}

.tmp-project-card,
.tmp-invoice-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.tmp-project-card:hover,
.tmp-invoice-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.tmp-project-card h4,
.tmp-invoice-card h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 18px;
}

.project-meta,
.invoice-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
}

.project-meta span,
.invoice-meta span {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Loading overlay */
.tmp-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.tmp-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .tmp-main-app {
        padding: 10px;
    }
    
    .tmp-container {
        padding: 20px;
    }
    
    .tmp-header h1 {
        font-size: 2rem;
    }
    
    .tmp-nav-tabs {
        justify-content: center;
    }
    
    .tmp-translation-area {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tmp-translate-btn-container {
        order: 2;
    }
    
    .tmp-context-form {
        grid-template-columns: 1fr;
    }
    
    .advice-actions {
        flex-direction: column;
    }
    
    .tmp-voice-controls {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .tmp-tab-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .tmp-btn-primary,
    .tmp-btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .project-meta,
    .invoice-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Accessibility improvements */
.tmp-tab-btn:focus,
.tmp-btn-primary:focus,
.tmp-btn-secondary:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.tmp-select:focus,
.tmp-input:focus,
textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 1px;
}

/* Print styles */
@media print {
    .tmp-nav-tabs,
    .advice-actions,
    .tmp-loading-overlay {
        display: none !important;
    }
    
    .tmp-main-app {
        box-shadow: none;
        background: white;
    }
    
    .tmp-advice-result {
        border: 1px solid #333;
        box-shadow: none;
    }
}

/* Success and error states */
.tmp-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.tmp-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

/* Language selector improvements */
.tmp-select optgroup {
    font-weight: bold;
    color: #495057;
}

.tmp-select option {
    padding: 8px;
}

/* Animation for successful translations */
.tmp-result-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}