/* Oposiciones AI Assistant - Frontend Styles */

.oposiciones-chat-container {
    max-width: 800px;
    margin: 20px auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.oposiciones-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.header-actions {
    display: flex !important;
    gap: 10px;
    align-items: center;
}

.header-back-btn, .header-print-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 8px 15px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px);
}

.header-back-btn:hover, .header-print-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.oposiciones-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #8E24AA 100%);
    opacity: 0.9;
    z-index: 1;
}

.oposiciones-chat-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    position: relative;
    z-index: 2;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.oposiciones-chat-mode-selector {
    padding: 40px 30px;
    text-align: center;
}

.mode-selector-content p {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
}

.mode-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 20px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.mode-btn.test-mode {
    background: linear-gradient(135deg, #8E24AA 0%, #7B1FA2 100%);
    box-shadow: 0 4px 15px rgba(142, 36, 170, 0.3);
}

.mode-btn.test-mode:hover {
    box-shadow: 0 8px 25px rgba(142, 36, 170, 0.4);
}

.mode-icon {
    font-size: 1.5em;
}

.oposiciones-chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 18px;
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.message.assistant {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #8E24AA;
}

.message.thinking {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #666;
    align-self: flex-start;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.oposiciones-chat-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.input-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
}

.input-container textarea {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

.input-container textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    min-width: 100px;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.back-btn {
    background: linear-gradient(135deg, #8E24AA 0%, #7B1FA2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 10px rgba(142, 36, 170, 0.3) !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.back-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(142, 36, 170, 0.4) !important;
}

/* Scrollbar personalizado */
.oposiciones-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.oposiciones-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.oposiciones-chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4CAF50 0%, #8E24AA 100%);
    border-radius: 3px;
}

.oposiciones-chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #45a049 0%, #7B1FA2 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .oposiciones-chat-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn {
        min-width: 250px;
    }
    
    .input-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .send-btn {
        align-self: flex-end;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Animaciones de entrada */
.oposiciones-chat-container {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Chat Actions */
.chat-actions {
    display: flex !important;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.print-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3) !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.print-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4) !important;
}

/* Test Container */
.test-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.test-question {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #8E24AA;
}

.test-question h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.test-question p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-option:hover {
    border-color: #8E24AA;
    background: #f3e5f5;
}

.test-option input[type="radio"] {
    margin-right: 10px;
}

.test-option input[type="radio"]:checked + span {
    color: #8E24AA;
    font-weight: 600;
}

.submit-test-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 20px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.submit-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* Test Results */
.oposiciones-test-results {
    padding: 30px;
    background: white;
}

.score-display {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.score-display h3 {
    margin-bottom: 15px;
    color: #333;
}

.score-number {
    font-size: 3em;
    font-weight: bold;
    margin: 15px 0;
}

.score-excellent {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.score-good {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
}

.score-pass {
    background: linear-gradient(135deg, #FFC107 0%, #FF8F00 100%);
    color: white;
}

.score-fail {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    color: white;
}

.detailed-results {
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid;
}

.result-item.correct {
    background: #e8f5e8;
    border-left-color: #4CAF50;
}

.result-item.incorrect {
    background: #ffeaea;
    border-left-color: #F44336;
}

.result-item h4 {
    margin-bottom: 10px;
    color: #333;
}

.result-item p {
    margin-bottom: 5px;
    color: #555;
}

.test-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.new-test-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.new-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.print-test-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.print-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Responsive para nuevos elementos */
@media (max-width: 768px) {

    
    .chat-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .test-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .test-actions button {
        min-width: 200px;
    }
}

/* Test Actions Bottom */
.test-actions-bottom {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.back-button-container {
    margin: 20px 0;
    text-align: center;
}

.back-button-container .back-btn {
    background: linear-gradient(135deg, #8E24AA 0%, #7B1FA2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(142, 36, 170, 0.3);
}

.back-button-container .back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 36, 170, 0.4);
}

/* Responsive para test actions bottom */
@media (max-width: 768px) {
    .test-actions-bottom {
        flex-direction: column;
        align-items: center;
    }
    
    .test-actions-bottom button {
        min-width: 200px;
    }
}