/* ========================
   Main Container
======================== */
.symptom-tracker-container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    background: #f5f7fa;
    font-family: 'Arial', sans-serif;
    overflow-x: auto;
}

/* ========================
   Headings
======================== */
.symptom-tracker-container h2,
.symptom-tracker-container h3,
.symptom-tracker-container h4 {
    text-align: center;
    margin: 15px 0 10px;
    font-size: 1.5em;
    color: #005f8d;
    border-bottom: 2px solid #d1d1d1;
    padding-bottom: 5px;
    font-weight: bold;
}


/* Title Styling */
.symptom-manager-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: #0a5175;
    background: linear-gradient(to right, #f8f9fa, #eef5f9);
    padding: 14px 18px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    margin: 10px auto;
}

/* Icon Styling */
.symptom-manager-title i {
    font-size: 24px;
    margin-right: 10px;
    color: #0073AA;
    animation: rotateIcon 1s ease-in-out;
}

/* Subtitle (Max Limit) */
.symptom-manager-title .max-limit {
    font-size: 14px;
    color: #555;
    margin-left: 8px;
    font-weight: normal;
}

/* Responsive Fix */
@media (max-width: 768px) {
    .symptom-manager-title {
        font-size: 18px;
        padding: 12px;
        text-align: center;
        flex-direction: column;
        box-shadow: none;
    }

    .symptom-manager-title i {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .symptom-manager-title .max-limit {
        font-size: 13px;
        margin-left: 0;
        display: block;
    }
}

/* Smooth Icon Animation */
@keyframes rotateIcon {
    0% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

/* ========================
   Tabs Navigation
======================== */
.symptom-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    background: #e7f0f7;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    overflow: hidden;
    flex-wrap: nowrap;
}

.symptom-tab-button {
    flex: 1;
    padding: 12px;
    cursor: pointer;
    background: #f0f7fc;
    border: none;
    color: #0073aa;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    transition: background 0.3s ease, color 0.3s ease;
}

.symptom-tab-button:hover {
    background: #0073aa;
    color: white;
}

.symptom-tab-button.active {
    background: #0073aa;
    color: white;
    font-weight: bold;
    border-bottom: 2px solid #005f8d;
}

/* ========================
   Button Group
======================== */

.button-group {
    display: flex;
    gap: 10px;  /* Adds space between buttons */
    justify-content: start; /* Aligns buttons to the left */
}

.button-group button {
    flex: 1; /* Makes buttons equal width */
    max-width: 100px; /* Optional: Adjust as needed */
}


/* ========================
   Row serial Number
======================== */
.serial-number {
    font-size: 16px;
    font-weight: bold;
    color: #0a5175;
    min-width: 30px;
    text-align: center;
}


/* ========================
   Symptom Delete/Edit Row
======================== */


/* Symptom Row - Flex Layout for Consistency */
.symptom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease-in-out;
    max-width: 600px;
    margin: auto;
}

.editable-symptom {
    flex-grow: 1;
    padding: 6px 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.editable-symptom:focus {
    border-color: #0073AA;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.save-symptom-btn,
.delete-symptom-btn {
    flex-grow: 1; /* Buttons take less space */
    max-width: 80px; /* Ensures buttons stay compact */
}

.symptom-actions {
    display: flex;
    gap: 5px;
}

.symptom-actions button {
    flex: 1; /* Make buttons equal width */
}

/* ========================
   Action Buttons
======================== */

/* Buttons */
.icon-btn {
    background: #5a6771;
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.icon-btn:hover {
    background: #4CAF50;
}

.delete-symptom-btn:hover {
    background: #d9534f;
}

/* Icons */
.icon-btn i {
    font-size: 14px;
}


.action-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.delete-btn {
    color: red;
}

/* ✅ Responsive Fix for Small Screens */
@media (max-width: 480px) {
    .symptom-item {
        flex-wrap: nowrap; /* 🔥 Fix: Ensure all elements stay in one line */
        justify-content: flex-start;
        padding: 8px;
        gap: 6px;
    }

    .serial-number {
        font-size: 14px;
        min-width: 25px;
    }

    .editable-symptom {
        flex-grow: 1;
        font-size: 14px;
        padding: 5px 8px;
    }

    .symptom-actions {
        display: flex;
        flex-wrap: nowrap; /* 🔥 Fix: Ensure buttons do not break to the next line */
        gap: 6px;
    }

    .icon-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 36px;
    }
}

/* ========================
   Symptom Intes
======================== */

.symptom-intensity {
    width: 80px;     /* Make the input smaller */
    height: 30px;    /* Adjust height */
    font-size: 14px; /* Adjust font size for better readability */
    text-align: center;
    padding: 2px;
}


/* ========================
   Tab Content Area
======================== */
.symptom-tab-content {
    display: none;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 5px;
    padding-top: 5px;
    background: white;
    border: 1px solid #d1d1d1;
    border-radius: 5px;
    margin-top: -1px;
}

/* ========================
   Tables
======================== */
.symptom-log-table,
.monthly-chart-table {
    width: max-content; /* Ensure table expands naturally */
    min-width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #d1d1d1;
    margin: 10px 0;
}

.symptom-log-table th,
.symptom-log-table td,
.monthly-chart-table th,
.monthly-chart-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd; /* Optional: Keep clean table borders */
    font-size: 14px;
    white-space: nowrap;
}

.symptom-log-table th,
.monthly-chart-table th {
    background: #0073aa;
    color: white;
    font-weight: bold;
}

.monthly-chart-table thead {
    background-color: #0073aa;
    color: white;
}

.monthly-chart-table th:first-child {
    width: 250px;
    text-align: left;
    font-weight: bold;
}

/* Ensure wrapper allows scrolling */
.monthly-chart-outer-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    display: block;
    white-space: nowrap;
    position: relative;
}

/* Ensure Table Doesn't Shrink */
.monthly-chart-outer-wrapper table {
    width: max-content;  /* Allows natural width */
    min-width: 100%;  /* Ensures it doesn't shrink too much */
    border-collapse: collapse;
}

/* Ensure the inner wrapper does not restrict scrolling */
.custom-symptom-chart-wrapper {
    overflow-x: auto !important;
    width: 100% !important;
    display: block;
    max-width: none !important;
}





/* Table Cells */
#monthly-symptom-chart-grid th,
#monthly-symptom-chart-grid td {
    padding: 8px;
    border: 1px solid #ccc;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sticky Header */
#monthly-symptom-chart-grid thead th {
    position: sticky;
    top: 0;
    background-color: #0073aa;
    color: white;
    z-index: 2;
}

/* First Column: Reduce Width & Left Align */
#monthly-symptom-chart-grid th:first-child,
#monthly-symptom-chart-grid td:first-child {
    width: 120px !important;  /* Decrease width */
    max-width: 150px !important;
    min-width: 100px !important;
    text-align: left !important;  /* Align text to the left */
    padding-left: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;  /* Avoid breaking text */
}

/* Table wrapper ensuring horizontal scroll works */
#monthly-symptom-chart-grid {
    overflow-x: scroll !important;
    display: block;
    min-width: 1200px !important;
    width: auto !important;
}

/* Ensure table behaves properly */
#monthly-symptom-chart-grid table {
    table-layout: auto;
    min-width: 1200px !important;  /* Forces the table to be wide */
    width: max-content !important;
}

/* On smaller screens, allow more room for symptom names if needed */
@media (max-width: 768px) {
    #monthly-symptom-chart-grid th:first-child,
    #monthly-symptom-chart-grid td:first-child {
        width: 30%;                  /* Slightly more width on small screens */
        min-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}





/* Ensure parent wrapper doesn’t collapse */
.symptom-tab-content {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}



/* ========================
   Buttons (Modern UI/UX with Proper Hover)
======================== */
.primary-button,
.secondary-button,
#download-symptom-data {
    padding: 8px 14px;
    background-color: #0073AA;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.primary-button:hover {
    background-color: #005a8c;
}

.admin-list-container {
    max-width: 500px;
    margin: 0 auto;
}



/* ========================
   Save Symptoms Log Button with Hover
======================== */
#save-symptom-intensities {
    background: #0073aa !important;
    color: white !important;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease, transform 0.2s ease;
    width: auto;
    max-width: 100%;
}

#save-symptom-intensities:hover {
    background: #005f8d !important;
    transform: translateY(-2px);
}

/* Secondary Button - Modern Grey */
.secondary-button {
    background: #6c757d;
    color: white;
}

.secondary-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Download Button - Modern Green */
#download-symptom-data {
    background: #28a745;
    color: white;
}

#download-symptom-data:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Full-width button for mobile */
@media (max-width: 768px) {
    #save-symptom-intensities {
        width: 100%;
        box-sizing: border-box;
        margin-top: 10px;
    }

    .primary-button {
        width: 100%;
        box-sizing: border-box;
    }
}


/* ========================
   Admin Symptom List
======================== */

/* ✅ Symptom List Styling */
.symptom-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 600px;
    margin: auto;
}

/* ✅ Symptom Item: Ensures Everything Stays in One Row */
.symptom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease-in-out;
}

/* Admin Panel Styling */
.admin-heading {
    font-size: 18px;
    color: #004a80;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.admin-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.admin-input-section {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.symptom-input {
    flex-grow: 1;
    padding: 6px 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.symptom-input:focus {
    border-color: #0073AA;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.symptom-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.symptom-edit, .symptom-delete {
    background: #5a6771;
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.symptom-edit:hover {
    background: #4CAF50;
}

.symptom-delete:hover {
    background: #d9534f;
}

/* 📱 Responsive Fix for Small Screens */
@media (max-width: 480px) {
    .symptom-row {
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 8px;
        gap: 6px;
    }

    .symptom-serial {
        font-size: 14px;
        min-width: 25px;
    }

    .symptom-input {
        width: calc(100% - 90px);
        font-size: 14px;
        padding: 5px 8px;
    }

    .symptom-edit, .symptom-delete {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 36px;
    }
}

/* Icons */
.symptom-edit i, .symptom-delete i {
    font-size: 14px;
}

#symptom-list {
    list-style: none;
    padding: 0;
}

#symptom-list li {
    padding: 10px;
    background: #f0f7fc;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #0073aa;
}

#symptom-list button {
    padding: 6px 12px;
    font-size: 12px;
    background: #6c757d;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s, transform 0.2s;
}

#symptom-list button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ========================
   File Upload Section
======================== */
#upload-medical-files-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-input {
    padding: 8px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
}

/* ========================
   Access Denied
======================== */
.access-denied {
    text-align: center;
    padding: 15px;
    background: #ffecec;
    color: #cc0000;
    border: 1px solid #cc0000;
    border-radius: 4px;
}

/* ========================
   Graph Wrapper
======================== */
.symptom-graph-wrapper {
    background: white;
    border: 1px solid #d1d1d1;
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 10px;
    overflow-x: auto;
    max-width: 100%;
}

.symptom-graph-wrapper h4 {
    margin: 5px 0;
    font-size: 14px;
    color: #0073aa;
    font-weight: bold;
    text-align: center;
}

.symptom-graph-wrapper canvas {
    width: 100% !important;
    max-width: 100%;
    height: 300px !important;
}

/* ========================
   Responsive Handling
======================== */
@media (max-width: 768px) {
    .symptom-tab-button {
        font-size: 10px;
        padding: 8px;
    }

    .symptom-log-table th,
    .symptom-log-table td,
    .monthly-chart-table th,
    .monthly-chart-table td {
        padding: 5px;
        font-size: 12px;
    }

    #symptom-list li {
        
        align-items: flex-start;
        font-size: 12px;
    }

    #symptom-list button {
        width: 100%;
        margin-top: 5px;
    }
}

/* ========================
   Elegant Loading Shimmer
======================== */
.loading-shimmer {
    height: 40px;
    background: linear-gradient(90deg, #f0f7fc 25%, #e7f0f7 50%, #f0f7fc 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.inline-symptom-message {
    font-size: 0.95rem;
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 500;
    display: block;
}

/* Color logic handled by type class */
.inline-symptom-message.success {
    background: #e6ffed;
    color: #155724;
    border: 1px solid #28a745;
}

.inline-symptom-message.error {
    background: #fff3f3;
    color: #c0392b;
    border: 1px solid #c0392b;
}


