/* IUS Exam Finder - Frontend Styles */

.ius-exam-finder-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.ius-exam-finder-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ius-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.ius-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.ius-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.ius-chat-container {
    padding: 20px;
    min-height: 400px;
    position: relative;
}

.ius-messages {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
}

.ius-message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.ius-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.ius-bot-message .ius-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ius-bot-message .ius-message-avatar svg {
    width: 24px;
    height: 24px;
}

.ius-user-message {
    flex-direction: row-reverse;
}

.ius-user-message .ius-message-avatar {
    background: #e0e7ff;
    color: #667eea;
    margin-right: 0;
    margin-left: 12px;
}

.ius-message-content {
    flex: 1;
    background: #f7fafc;
    padding: 15px;
    border-radius: 12px;
    max-width: 70%;
}

.ius-user-message .ius-message-content {
    background: #667eea;
    color: white;
}

.ius-message-content p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.ius-message-content p:last-child {
    margin-bottom: 0;
}

.ius-message-hint {
    font-size: 14px;
    opacity: 0.8;
    font-style: italic;
}

.ius-exam-results {
    margin-top: 20px;
}

.ius-exam-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ius-exam-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.ius-exam-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.ius-exam-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.ius-exam-price {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.ius-exam-category {
    display: inline-block;
    background: #e0e7ff;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.ius-exam-description {
    color: #4a5568;
    line-height: 1.6;
    margin: 10px 0;
}

.ius-exam-link {
    display: inline-flex;
    align-items: center;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-top: 10px;
}

.ius-exam-link:hover {
    text-decoration: underline;
}

.ius-exam-link svg {
    width: 16px;
    height: 16px;
    margin-left: 4px;
}

.ius-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ius-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s ease;
}

.ius-input:focus {
    outline: none;
    border-color: #667eea;
}

.ius-send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.ius-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ius-send-button:active {
    transform: translateY(0);
}

.ius-send-button svg {
    width: 20px;
    height: 20px;
}

.ius-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ius-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: #667eea;
    font-weight: 500;
}

.ius-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e7ff;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ius-footer {
    background: #f7fafc;
    padding: 20px;
    text-align: center;
}

.ius-disclaimer {
    margin: 0;
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

/* Dark theme */
.ius-exam-finder-wrapper[data-theme="dark"] .ius-exam-finder-container {
    background: #1a202c;
}

.ius-exam-finder-wrapper[data-theme="dark"] .ius-message-content {
    background: #2d3748;
    color: #e2e8f0;
}

.ius-exam-finder-wrapper[data-theme="dark"] .ius-exam-card {
    background: #2d3748;
    border-color: #4a5568;
}

.ius-exam-finder-wrapper[data-theme="dark"] .ius-exam-title {
    color: #e2e8f0;
}

.ius-exam-finder-wrapper[data-theme="dark"] .ius-exam-description {
    color: #cbd5e0;
}

.ius-exam-finder-wrapper[data-theme="dark"] .ius-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.ius-exam-finder-wrapper[data-theme="dark"] .ius-footer {
    background: #2d3748;
}

/* Responsive */
@media (max-width: 768px) {
    .ius-exam-finder-wrapper {
        padding: 10px;
        margin: 20px auto;
    }
    
    .ius-header {
        padding: 20px;
    }
    
    .ius-header h2 {
        font-size: 22px;
    }
    
    .ius-message-content {
        max-width: 85%;
    }
    
    .ius-input-container {
        flex-direction: column;
    }
    
    .ius-send-button {
        width: 100%;
        justify-content: center;
    }
    
    .ius-exam-card-header {
        flex-direction: column;
        gap: 10px;
    }
}
