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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

header {
    border-bottom: 3px solid #4a90e2;
    margin-bottom: 30px;
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: #1e3a8a;
    font-size: 32px;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-link:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.loading-spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.selected-drugs-summary {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #3b82f6;
}

.selected-drugs-summary h2 {
    color: #1e3a8a;
    font-size: 18px;
    margin-bottom: 12px;
}

.drugs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.drug-badge {
    display: inline-block;
    padding: 6px 14px;
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1e3a8a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-header {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.results-header h2 {
    color: #1e3a8a;
    font-size: 24px;
    margin-bottom: 5px;
}

.results-header p {
    color: #64748b;
    font-size: 14px;
}

.result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid;
    animation: slideIn 0.4s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.result strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.result-content {
    margin: 15px 0;
    padding: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
}

.result-gravidade {
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

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

.result-recomendacao {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(0,0,0,0.1);
}

.result-recomendacao strong {
    display: block;
    margin-bottom: 8px;
}

.result-recomendacao p {
    margin: 0;
    line-height: 1.6;
}

.alta { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
    color: #991b1b;
}

.moderada { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
}

.baixa { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    color: #065f46;
}

.no-interactions {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 12px;
    border-left: 5px solid #10b981;
}

.no-interactions strong {
    display: block;
    font-size: 20px;
    color: #065f46;
    margin-bottom: 10px;
}

.no-interactions p {
    color: #065f46;
    line-height: 1.6;
}

.error {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: 12px;
    border-left: 5px solid #dc2626;
}

.error strong {
    display: block;
    font-size: 20px;
    color: #991b1b;
    margin-bottom: 10px;
}

.error p {
    color: #991b1b;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .result {
        padding: 16px;
    }
    
    .selected-drugs-summary {
        padding: 16px;
    }
}