:root {
    --primary-gradient: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    --secondary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --medical-green: #00a878;
    --medical-teal: #00b4d8;
    --medical-blue: #0077b6;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --bg-light: #f8f9fa;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
}

main {
    flex: 1;
    padding: 2rem 0;
}

.navbar {
    background: var(--primary-gradient) !important;
    box-shadow: 0 4px 20px rgba(0, 180, 219, 0.3);
    border: none;
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand::before {
    content: '🏥';
    font-size: 1.8rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    background: white;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-weight: 700;
    color: var(--medical-blue);
    margin-bottom: 1.5rem;
}

h1 {
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h5 {
    color: var(--medical-teal);
    font-weight: 600;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

textarea.form-control {
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    transition: all 0.3s ease;
    background: #fafbfc;
}

textarea.form-control:focus {
    border-color: var(--medical-teal);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.1);
    background: white;
}

textarea.form-control::placeholder {
    color: #a0aec0;
}

.btn-primary {
    background: var(--secondary-gradient);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#submitBtn {
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

#submitBtn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

#submitBtn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    border-color: var(--medical-teal);
    border-right-color: transparent;
}

#loadingSpinner {
    animation: fadeIn 0.3s ease;
}

#loadingSpinner p {
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#result {
    animation: slideIn 0.5s ease;
}

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

#result .card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 4px solid var(--medical-green);
}

#result .card-title::before {
    content: '✓ ';
    color: var(--medical-green);
}

#adviceContent {
    line-height: 1.8;
    color: var(--text-primary);
}

#adviceContent br {
    display: block;
    margin-bottom: 0.5rem;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: none;
    border-radius: 16px;
    border-left: 4px solid #f39c12;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
}

.alert-warning strong {
    color: #856404;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: none;
    border-radius: 16px;
    border-left: 4px solid #e74c3c;
    padding: 1.25rem 1.5rem;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: none;
    border-radius: 16px;
    border-left: 4px solid var(--medical-teal);
    padding: 1.5rem;
}

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem;
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 20px 20px 0 0 !important;
}

.history-card {
    border-left: 4px solid var(--medical-teal);
}

.history-card:hover {
    border-left-color: var(--medical-green);
}

.symptom-text {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.response-text {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f0 100%);
    padding: 1.25rem;
    border-radius: 12px;
    line-height: 1.8;
    border: 1px solid #c8e6c9;
}

.no-history-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title .icon-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.section-title h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn-primary {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    body {
        font-size: 0.95rem;
    }
}

.btn-outline-primary {
    border: 2px solid var(--medical-teal);
    color: var(--medical-teal);
    border-radius: 12px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--medical-teal);
    border-color: var(--medical-teal);
    color: white;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 5rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}