
:root {
    /* Color Palette */
    --primary-glow: #00f2fe;
    --primary-accent: #38bdf8;
    --primary-hover: #0284c7;
    --ai-purple: #818cf8;
    
    --bg-dark: #090d16;
    --glass-card: rgba(15, 23, 42, 0.78);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-focus: rgba(56, 189, 248, 0.5);
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --rx-paper-bg: #ffffff;
    --rx-brand-blue: #0284c7;
}

/* --- Base & Reset Rules --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', 'Inter', system-ui, -apple-system, sans-serif;
    word-break: break-word;
    overflow-wrap: break-word;
}

body {
    background-color: var(--bg-dark);
    
   
    background-image: 
        linear-gradient(135deg, rgba(9, 13, 22, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%),
        url('627058011_915956991347956_7122116475994450660_n.jpg'); 
        
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Wrapper Container */
.app-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- App Header / Navigation --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 16px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 30px;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.logo-area h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #ffffff, var(--primary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Language Switcher Radio Group */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.lang-selector label {
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: color 0.2s;
}

.lang-selector input[type="radio"] {
    accent-color: var(--primary-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* --- Main Responsive Layout Grid --- */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    flex: 1;
    align-items: start;
}

/* Card General Glass Styling */
.card {
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.card:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

/* --- Input Section --- */
.input-panel h2 {
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

textarea#diseaseInput {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    background: rgba(9, 13, 22, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    resize: none;
    margin-bottom: 18px;
    transition: all 0.3s ease;
    line-height: 1.6;
}

textarea#diseaseInput:focus {
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
    background: rgba(9, 13, 22, 0.85);
}

textarea#diseaseInput::placeholder {
    color: #64748b;
}

/* Button Styling */
.btn-group {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-glow));
    color: #04111d;
    flex: 2;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

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

.btn-secondary {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    flex: 1;
}

.btn-secondary:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ffffff;
}

/* History Card */
.history-card h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

/* History Scrollbar */
.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.history-item:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateX(4px);
}

/* --- Digital Prescription Pad (Output Panel) --- */
.prescription-pad {
    background: var(--rx-paper-bg);
    color: var(--text-dark);
    padding: 35px;
    border-radius: 16px;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.rx-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
}

.doc-info h2 {
    font-size: 20px;
    color: var(--rx-brand-blue);
    font-weight: 700;
    margin-bottom: 2px;
}

.doc-info p {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.doc-info small {
    font-size: 11px;
    color: #64748b;
}

.rx-symbol {
    font-size: 38px;
    font-weight: 800;
    color: var(--rx-brand-blue);
    font-family: Georgia, serif;
    line-height: 1;
}

.rx-divider {
    border: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--rx-brand-blue), #93c5fd);
    margin: 10px 0 16px 0;
}

.patient-meta {
    display: flex;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    color: #334155;
}

/* Loader Animation */
.loader-container {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--rx-brand-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

#uiLoaderText {
    font-size: 13px;
    color: #64748b;
}

/* Prescription Output Text Body */
.rx-body {
    flex: 1;
    font-size: 14.5px;
    line-height: 1.8;
    color: #0f172a;
}

.rx-body h3 {
    font-size: 15px;
    color: #0369a1;
    margin-top: 18px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 4px;
    font-weight: 700;
}

.rx-body div, .rx-body p {
    margin-bottom: 6px;
}

.placeholder-text {
    text-align: center;
    color: #94a3b8;
    margin-top: 120px;
    font-size: 14px;
}

/* Rx Footer */
.rx-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 25px;
    font-size: 11px;
    color: #64748b;
    text-align: center;
}

/* Global Footer */
.app-footer {
    text-align: center;
    padding: 20px 0 10px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.app-footer strong {
    color: var(--primary-accent);
}

/* =========================================================
   📱 MOBILE & TABLET RESPONSIVE RULES (Prevent Layout Breaking)
   ========================================================= */

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr; /* Single Column Layout */
        gap: 16px;
    }

    .app-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
        padding: 16px;
    }

    .lang-selector {
        width: 100%;
        justify-content: space-around;
    }

    .prescription-pad {
        padding: 20px 16px;
        min-height: auto;
    }

    .doc-info h2 {
        font-size: 17px;
    }

    .rx-symbol {
        font-size: 30px;
    }

    .patient-meta {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }

    .card {
        padding: 16px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    textarea#diseaseInput {
        font-size: 14px;
    }
}



@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .app-header, 
    .input-panel, 
    .app-footer, 
    .btn-group, 
    .history-card {
        display: none !important;
    }

    .app-container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .main-content {
        display: block !important;
    }

    .prescription-pad {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: white !important;
    }
}
