/* Touch-friendly improvements for mobile */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for inputs and content areas */
input, textarea, [contenteditable], .analysis-content, .analysis-text {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Ensure buttons and form elements are interactive */
button, .btn, [role="button"], input[type="submit"], input[type="button"], .auth-submit-btn {
    touch-action: manipulation;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

button:active, .btn:active, [role="button"]:active {
    transform: scale(0.98);
}

/* Ensure authentication forms are fully interactive */
#auth-modal, #auth-modal *, .auth-form, .auth-form *, .auth-submit-btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

.auth-submit-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
}

.auth-submit-btn:hover {
    background-color: #228a9b !important;
    transform: translateY(-1px);
}

.auth-submit-btn:active {
    transform: translateY(0px) scale(0.98);
}

/* General Body and Typography */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Body doesn't scroll, main element does */
}

/* Scrolling fix for main content area */
main {
    flex-grow: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
}

/* Ensure page-specific main elements can scroll */
.biopsychosocial-main,
.wellness-hub-main,
.activities-main,
.profile-main,
.wearables-main {
    min-height: 100%;
    overflow-y: auto !important;
    padding-bottom: 2rem;
}

/* Modal handling - prevent body scroll only when modal is open */
body.modal-open {
    overflow: hidden !important;
}

body.modal-open main {
    overflow-y: auto !important;
}

.container {
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 50px;
    margin-right: 20px;
}

.header-text h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a237e;
    margin: 0;
}

.header-text p {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.nav-buttons .nav-button {
    background-color: transparent;
    border: 2px solid #1a237e;
    color: #1a237e;
    padding: 10px 20px;
    margin-left: 10px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-buttons .nav-button:hover, .nav-buttons .nav-button.active {
    background-color: #1a237e;
    color: #ffffff;
}

/* Main Content Layout */
main {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto; /* Changed from hidden to auto */
    display: flex;
}

#analyzer-section {
    width: 100%;
    display: flex;
}

#analyzer-section .container {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100%;
    padding: 0;
}

#left-panel {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 35%;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#right-panel {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 65%;
    overflow-y: auto;
}

/* Left Panel Components */
#left-panel h2 {
    font-size: 1.4rem;
    color: #1a237e;
    margin-top: 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.ingredient-input-group {
    display: flex;
    margin-bottom: 10px;
}

.ingredient-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

#add-ingredient-btn, #analyze-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

#add-ingredient-btn {
    background-color: #e8eaf6;
    color: #1a237e;
}

#add-ingredient-btn:hover {
    background-color: #c5cae9;
}

#analyze-btn {
    background-color: #3949ab;
    color: white;
}

#analyze-btn:hover {
    background-color: #303f9f;
}

/* Right Panel Components */
#results-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.placeholder-content {
    text-align: center;
    margin: auto;
    color: #777;
}

#analysis-loading {
    text-align: center;
    margin: auto;
}

#analysis-results {
    display: none; /* Initially hidden */
}

#results-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

#active-molecule-card, .excipient-card {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#active-molecule-card h3, .excipient-card h4 {
    margin-top: 0;
    color: #303f9f;
}

/* Translation information styling */
.translation-info {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border: 1px solid #4caf50;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 0.9em;
    color: #2e7d32;
    font-style: italic;
}

.translation-info strong {
    color: #1b5e20;
    font-weight: 600;
}

#excipient-molecules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

#analysis-text {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* New Collapsible Analysis Sections */
.analysis-section {
    margin-bottom: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.analysis-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.analysis-section h3 {
    margin: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    user-select: none;
}

.analysis-section h3:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.analysis-section h3::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.2s ease;
}

.analysis-section.collapsed h3::after {
    transform: rotate(-90deg);
}

.analysis-section .content {
    padding: 20px;
    background: #fafbfc;
    border-top: 1px solid #e1e5e9;
    line-height: 1.6;
    transition: all 0.3s ease;
    overflow: hidden;
}

.analysis-section.collapsed .content {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
}

.analysis-section .content p {
    margin-bottom: 12px;
}

.analysis-section .content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.analysis-section .content li {
    margin-bottom: 8px;
    color: #444;
}

.analysis-section .content strong {
    color: #2c3e50;
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background-color: #e8eaf6;
}

.collapsible-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a237e;
}

.toggle-icon {
    margin-right: 10px;
    font-size: 1rem;
    color: #3949ab;
    transition: transform 0.2s ease;
}

.collapsible-content {
    display: none; /* Hidden by default */
    padding: 15px;
    border-left: 3px solid #3949ab;
    background-color: #fafafa;
    margin-bottom: 10px;
    border-radius: 0 5px 5px 0;
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    border: 1px solid #d32f2f;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Comparator Section */
#comparator-section {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

#comparator-section h2, #comparator-section > p {
    text-align: center;
    color: #1a237e;
}

#comparator-section > p {
    color: #555;
    max-width: 800px;
    margin: 0 auto 30px auto;
}

.formulation-comparison-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.formulation-input {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 45%;
    max-width: 500px;
}

.formulation-input h3 {
    font-size: 1.3rem;
    color: #303f9f;
    margin-top: 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.formulation-input textarea {
    width: 100%;
    height: 200px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.goal-selector {
    text-align: center;
    margin: 0 auto 30px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 600px;
}

.goal-selector h3 {
    margin-top: 0;
    color: #1a237e;
}

.goal-selector p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.goal-selector select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.goal-selector select:hover {
    border-color: #3949ab;
    box-shadow: 0 0 8px rgba(57, 73, 171, 0.2);
}

#compare-formulations-btn {
    display: block;
    margin: 0 auto;
    background-color: #3949ab;
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(57, 73, 171, 0.3);
}

#compare-formulations-btn:hover {
    background-color: #303f9f;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(57, 73, 171, 0.4);
}

#comparison-results-container {
    margin-top: 30px;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.recommendation-box {
    margin-top: 20px;
    padding: 20px;
    background-color: #e8eaf6;
    border-left: 5px solid #3949ab;
    border-radius: 8px;
}

.prose {
    line-height: 1.7;
}

.prose h3 {
    color: #1a237e;
}

.prose strong {
    font-weight: 600;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: slide-down 0.3s ease-out;
}

@keyframes slide-down {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

.pbpk-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

#run-pbpk-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

#pbpk-chart {
    margin-top: 20px;
    max-height: 300px;
}


/* DNA Animation Styles */
.dna-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    margin-bottom: 20px;
}

.dna-animation {
    height: 100%;
}

#strand-a, #strand-a-comp, #strand-a-pbpk {
    animation: dna-dance-a 3s ease-in-out infinite;
}

#strand-b, #strand-b-comp, #strand-b-pbpk {
    animation: dna-dance-b 3s ease-in-out infinite;
}

@keyframes dna-dance-a {
    0% { 
        stroke-dashoffset: 0; 
        opacity: 0.8;
    }
    25% { 
        stroke-dashoffset: 6; 
        opacity: 1;
    }
    50% { 
        stroke-dashoffset: 12; 
        opacity: 0.6;
    }
    75% { 
        stroke-dashoffset: 18; 
        opacity: 1;
    }
    100% { 
        stroke-dashoffset: 24; 
        opacity: 0.8;
    }
}

@keyframes dna-dance-b {
    0% { 
        stroke-dashoffset: 12; 
        opacity: 1;
    }
    25% { 
        stroke-dashoffset: 6; 
        opacity: 0.6;
    }
    50% { 
        stroke-dashoffset: 0; 
        opacity: 1;
    }
    75% { 
        stroke-dashoffset: -6; 
        opacity: 0.8;
    }
    100% { 
        stroke-dashoffset: -12; 
        opacity: 1;
    }
}

/* Add to Supplements Button */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.analysis-header h3 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    flex: 1;
}

.add-to-supplements-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    white-space: nowrap;
}

.add-to-supplements-btn:hover {
    background: linear-gradient(135deg, #218838, #1a9972);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.add-to-supplements-btn:active {
    transform: translateY(0);
}

.add-to-supplements-btn .btn-icon {
    font-size: 16px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Responsive adjustments for the button */
@media (max-width: 768px) {
    /* Header improvements */
    header {
        padding: 15px 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
    }
    
    .header-text h1 {
        font-size: 1.5em;
        margin: 5px 0;
    }
    
    .header-text p {
        font-size: 0.9em;
        margin: 0;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        margin-top: 10px;
    }
    
    .nav-button {
        padding: 10px 16px;
        font-size: 0.9em;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Layout improvements */
    #analyzer-section .container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }
    
    #left-panel {
        width: 100%;
        min-width: unset;
        padding: 15px;
    }
    
    #right-panel {
        width: 100%;
        padding: 15px;
    }
    
    /* Input improvements */
    #ingredientsInput {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 100px;
    }
    
    /* Button improvements */
    button {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly minimum */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .analyze-btn {
        width: 100%;
        margin-top: 15px;
    }
    
    .analysis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .add-to-supplements-btn {
        align-self: stretch;
        justify-content: center;
        width: 100%;
    }
    
    /* Comparator improvements */
    .comparator-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .comparator-inputs input {
        width: 100%;
    }
    
    /* Modal improvements */
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: none;
        border-radius: 8px;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    /* General mobile optimizations */
    body {
        font-size: 14px;
    }
    
    header {
        padding: 10px 5px;
    }
    
    .header-content {
        gap: 5px;
    }
    
    .header-text h1 {
        font-size: 1.3em;
    }
    
    .header-text p {
        font-size: 0.8em;
    }
    
    .nav-button {
        padding: 8px 12px;
        font-size: 0.85em;
        min-width: 120px;
    }
    
    /* Main content optimizations */
    #analyzer-section .container {
        padding: 5px;
        gap: 10px;
    }
    
    #left-panel,
    #right-panel {
        padding: 10px;
        border-radius: 8px;
    }
    
    /* Input optimizations */
    #ingredientsInput {
        padding: 15px;
        font-size: 16px;
        min-height: 120px;
        border-radius: 8px;
    }
    
    /* Button optimizations */
    button {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    /* Results optimizations */
    .interaction-results {
        padding: 12px;
        margin: 10px 0;
    }
    
    .supplement-result {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    /* Modal optimizations */
    .modal-content {
        width: 98%;
        margin: 10px auto;
        padding: 15px;
        border-radius: 8px;
    }
}

/* Interaction results mobile styling */
.interaction-results {
    padding: 15px;
}

.supplement-result {
    margin-bottom: 15px;
}

/* Styling for WellnessIQ page */
.tip-content {
    font-size: 14px;
}

.input-option-btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Profile Integration Styles */
.profile-prompt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    color: white;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.prompt-card h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.prompt-card p {
    margin: 0 0 15px 0;
    opacity: 0.9;
    line-height: 1.5;
}

.create-profile-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.profile-integrated {
    background: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-icon {
    font-size: 20px;
}

.profile-badge span {
    color: #28a745;
    font-weight: 500;
    flex-grow: 1;
}

.edit-profile-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.edit-profile-btn:hover {
    background: #218838;
}

/* Input Tips and Options */
.input-tips {
    margin-bottom: 20px;
}

.tip-card {
    background: linear-gradient(135deg, #e3f2fd, #f0f8ff);
    border: 1px solid #2ca9bc;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(44, 169, 188, 0.1);
}

.tip-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.tip-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.tip-content strong {
    color: #2ca9bc;
    font-weight: 600;
}

.input-options {
    margin: 15px 0;
}

.option-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-option-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    color: #495057;
    font-weight: 500;
}

.input-option-btn:hover {
    background: #e9ecef;
    border-color: #2ca9bc;
    color: #2ca9bc;
}

.option-icon {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tip-card {
        padding: 12px;
        gap: 10px;
    }
    
    .tip-content {
        font-size: 13px;
    }
    
    .option-buttons {
        justify-content: center;
    }
    
    .input-option-btn {
        flex: 1;
        justify-content: center;
        min-width: 140px;
    }
}

/* Footer Styles */
.app-footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 25px 0;
    margin-top: auto;
    border-top: 3px solid #2ca9bc;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-branding {
    flex: 1;
}

.footer-branding p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-branding strong {
    color: #2ca9bc;
    font-weight: 600;
}

.ai-badge {
    color: #a8e6cf;
    font-size: 13px;
    font-weight: 500;
}

.footer-legal {
    flex: 1;
    text-align: right;
}

.footer-legal p {
    margin: 0;
    font-size: 12px;
    color: #bdc3c7;
    opacity: 0.9;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        text-align: center;
    }
}

/* Image Upload and Paste Helper Styles */
.image-processing-result,
.paste-success,
.paste-instructions {
    margin-bottom: 20px;
    animation: slideInFromTop 0.3s ease-out;
}

.processing-card,
.success-card,
.instruction-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
}

.processing-card h4,
.success-card h4,
.instruction-card h4 {
    color: #2ca9bc;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.processing-card p,
.success-card p {
    color: #6c757d;
    margin: 8px 0;
    line-height: 1.5;
}

.processing-card ul {
    color: #495057;
    margin: 12px 0;
    padding-left: 20px;
}

.processing-card ul li {
    margin: 6px 0;
    line-height: 1.4;
}

.instruction-steps {
    margin: 16px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #2ca9bc;
}

.step-number {
    background: #2ca9bc;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content strong {
    color: #343a40;
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
}

.step-content p {
    color: #6c757d;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.dismiss-btn {
    background: #2ca9bc;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.dismiss-btn:hover {
    background: #238da0;
    transform: translateY(-1px);
}

.dismiss-btn:active {
    transform: translateY(0);
}

/* Hidden file input */
#image-upload {
    display: none;
}

/* Animation for sliding in from top */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for instruction cards */
@media (max-width: 768px) {
    .processing-card,
    .success-card,
    .instruction-card {
        padding: 16px;
        margin: 0 -10px 20px -10px;
    }
    
    .step {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
}

/* Data Reliability Page Styles */
.reliability-main {
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.data-sources-section {
    margin-bottom: 40px;
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.source-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
}

.source-card.high-accuracy {
    border-left-color: #4caf50;
}

.source-card.moderate-accuracy {
    border-left-color: #ff9800;
}

.source-card.limited-accuracy {
    border-left-color: #f44336;
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.accuracy-badge {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.high-accuracy .accuracy-badge {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    color: #2e7d32;
}

.moderate-accuracy .accuracy-badge {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f57c00;
}

.limited-accuracy .accuracy-badge {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #d32f2f;
}

.source-note {
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-style: italic;
    color: #666;
}

/* Enhancement Roadmap */
.enhancement-section {
    margin-bottom: 40px;
}

.roadmap-timeline {
    position: relative;
    margin-top: 30px;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #4caf50, #2196f3, #ff9800, #9c27b0);
}

.timeline-item {
    position: relative;
    margin-left: 50px;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
}

.timeline-item.implemented .timeline-marker {
    background: #4caf50;
}

.timeline-item.planned .timeline-marker {
    background: #2196f3;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    margin-top: 0;
    color: #303f9f;
}

/* Agreement Section */
.agreement-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.agreement-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.agreement-item h3 {
    color: #303f9f;
    margin-bottom: 15px;
}

.disclaimer-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.disclaimer-box p {
    margin: 8px 0;
    color: #856404;
}

/* Consent Section */
.consent-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.consent-checkboxes {
    margin-bottom: 20px;
}

.consent-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 0.95em;
}

.consent-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.consent-item input[type="checkbox"]:checked + .checkmark {
    background: #4caf50;
    border-color: #4caf50;
}

.consent-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
}

.accept-button {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.accept-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.accept-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Mobile Responsiveness for Data Reliability */
@media (max-width: 768px) {
    .source-grid {
        grid-template-columns: 1fr;
    }
    
    .agreement-content {
        grid-template-columns: 1fr;
    }
    
    .roadmap-timeline {
        margin-left: 20px;
    }
    
    .timeline-item {
        margin-left: 30px;
    }
    
    .timeline-marker {
        left: -25px;
    }
    
    .step-number {
        align-self: flex-start;
        margin-bottom: 5px;
    }
    
    .step-content {
        width: 100%;
    }
    
    .processing-card h4,
    .success-card h4,
    .instruction-card h4 {
        font-size: 15px;
    }
}
