/* style.css - Common styles for Hospital Patient Tracker */

/* --- General --- */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 96%;
    max-width: 1800px;
    margin: 5px auto;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* --- Rich Text Editor (Placeholder - will need actual RTE styles) --- */
.rich-text-editor {
    border: 1px solid #ddd;
    padding: 10px;
    min-height: 150px;
    background-color: #fff;
}

h1, h2, h3 {
    color: #0056b3; /* A nice blue */
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* --- Navigation Menu --- */
nav.main-nav {
    background-color: #0056b3; /* Primary color */
    color: #fff;
    padding: 10px 0;
    margin-bottom: 20px;
}

nav.main-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

nav.main-nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav.main-nav ul li a {
    color: #fff;
    font-size: 1.1em;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

nav.main-nav ul li a:hover,
nav.main-nav ul li a.active {
    background-color: #004085; /* Darker shade for hover/active */
}

/* --- Forms --- */
form {
    margin-bottom: 20px;
}

form div {
    margin-bottom: 15px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="date"],
form input[type="time"],
form input[type="number"],
form select,
form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Important for 100% width */
}

form textarea {
    min-height: 100px;
    resize: vertical;
}

form input[type="checkbox"] {
    margin-right: 5px;
    vertical-align: middle;
}

form button,
.button,
input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 3px 7px;         /* Reduced padding */
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;         /* Slightly smaller font */
    opacity: 0.9;              /* Slightly transparent for softer appearance */
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

form button:hover,
.button:hover,
input[type="submit"]:hover {
    background-color: #0056b3;
    opacity: 1;
}

.button-danger {
    background-color: #dc3545;
}
.button-danger:hover {
    background-color: #c82333;
}
.button-secondary {
    background-color: #6c757d;
}
.button-secondary:hover {
    background-color: #5a6268;
}


/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9em; /* Slightly smaller for more data */
}

table th, table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

table th {
    background-color: #0056b3; /* Primary color for headers */
    color: #fff;
    font-weight: bold;
}

/* Alternating row colors - soft pastels */
table tbody tr:nth-child(even) {
    background-color: #e9f2fa; /* Light pastel blue */
}

table tbody tr:nth-child(odd) {
    background-color: #fdfdfe; /* Off-white, almost white */
}

table tbody tr:hover {
    background-color: #d4e6f7; /* Slightly darker blue on hover */
}

/* --- Compact Table View --- */
.compact-table {
    font-size: 0.75em;
}

.compact-table th,
.compact-table td {
    padding: 6px 8px;
    line-height: 1.2;
}

/* Specific column widths if needed */
/* Example: table td:nth-child(1) { width: 10%; } */

/* --- Messages (Success, Error) --- */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.95em;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* --- Patient List Specifics --- */
.patient-details-cell {
    line-height: 1.4;
}
.patient-details-cell strong { /* Patient Name */
    font-size: 1.1em;
    color: #0056b3;
}
.patient-details-cell .ur-dob,
.patient-details-cell .address-phone,
.patient-details-cell .gp-details {
    font-size: 0.9em;
    color: #555;
}

/* --- Journey Board --- */
.journey-board-table th, .journey-board-table td {
    /* Potentially different padding or font size if needed for density */
}

/* --- Responsive Design (Compact View for Phones) --- */
@media (max-width: 768px) {
    .container {
        width: 98%;
        padding: 10px;
    }

    nav.main-nav ul li {
        display: block;
        margin: 10px 0;
    }
    nav.main-nav ul li a {
        display: block;
    }

    /* Force tables to not be too wide */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%; /* Space for the label */
        text-align: right; /* Align content to the right */
    }

    table td::before {
        /* Now like a data label */
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left; /* Align label to the left */
        font-weight: bold;
        content: attr(data-label); /* Will need to add data-label attributes in PHP */
    }

    /* Specific adjustments for tables that are too complex for the above */
    .active-patients-table td, .journey-board-table td {
        /* May need more specific overrides if the general mobile table style isn't ideal */
    }

    form input[type="text"],
    form input[type="password"],
    form input[type="email"],
    form input[type="date"],
    form input[type="time"],
    form input[type="number"],
    form select,
    form textarea {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

/* --- Print Styles --- */
@media print {
    body {
        font-size: 9pt;
        background-color: #fff;
        color: #000;
    }
    nav.main-nav, .no-print, form button, .button, input[type="submit"]  {
        display: none !important;
    }
    .container {
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    table {
        font-size: 8pt;
        width: 100% !important; /* Ensure table uses full width */
        border: 1px solid #333 !important; /* Ensure borders are visible */
    }
    table th, table td {
        border: 1px solid #333 !important;
        padding: 4px;
        color: #000 !important; /* Ensure text is black */
        background-color: #fff !important; /* Remove background colors */
    }
    table th {
        background-color: #eee !important; /* Light grey for header background in print */
        font-weight: bold;
    }
    table tbody tr:nth-child(even),
    table tbody tr:nth-child(odd) {
        background-color: #fff !important; /* Remove alternating colors for print */
    }
    a {
        text-decoration: none;
        color: #000;
    }
    a[href^="http"]:after {
        /* content: " (" attr(href) ")"; /* Optionally show URLs for external links */
    }
    .page-break-before {
        page-break-before: always;
    }
    .page-break-after {
        page-break-after: always;
    }
    h1, h2, h3 {
        font-size: 1.1em;            /* Shrink headings */
        margin-bottom: 6px;
    }
    .message, nav.main-nav, .no-print, button, input[type="submit"] {
        display: none !important;    /* Hide unnecessary UI */
    }
}


    /* --- Clean up inner spacing in table cells --- */
table td p,
table td div {
    margin: 0;
    line-height: 1.4;
}


    /* --- Force small for Journey Board --- */
.force-small,
.force-small * {
    font-size: 10px !important;
}
