/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --primary-light: #e7f1ff;
    --secondary-color: #0dcaf0;
    --accent-teal: #14b8a6;
    --bg-light: #f0f7ff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #dbe0e7;
    color: var(--text-main);
    min-height: 100vh;
}

/* Auth Pages (Login & Register) */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.hospital-header {
    margin-bottom: 30px;
}

.hospital-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-teal));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.hospital-name {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.page-title {
    color: var(--text-muted);
    font-size: 16px;
}

/* Form Styles */
.form-group {
    text-align: left;
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-option span {
    font-size: 14px;
    font-weight: 500;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-teal));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.footer-link {
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dash-content {
    padding: 35px 40px 50px;
    /* Increased top padding for a better gap after navbar, and bottom padding for visibility */
}

/* Dashboard Navbar */
.dash-navbar {
    background: var(--white);
    height: 60px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-center {
    flex: 0 1 400px;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding-left: 45px;
    background: #f1f5f9;
    border-color: transparent;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.nav-icon-btn:hover {
    color: var(--primary-color);
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--white);
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 10px;
    transition: var(--transition);
}

.nav-profile:hover {
    background: var(--bg-light);
}

.profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

.profile-info {
    text-align: left;
}

.profile-info h4 {
    font-size: 14px;
    font-weight: 600;
}

.profile-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Patient Registration Form Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.btn-view {
    padding: 8px 20px;
    background: var(--white);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-view:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.registration-container {
    background: var(--white);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto 30px;
}

.registration-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 25px;
}

.form-group.full-width {
    grid-column: span 2;
}

.registration-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.registration-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 14px;
    outline: none;
    min-height: 80px;
    resize: vertical;
}

.submit-container {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-submit {
    padding: 14px 40px;
    width: auto;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid #e2e8f0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out, visibility 0.3s;
}

/* Sidebar Components (Merged from sidebar.css) */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-teal));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar-brand h3 {
    font-size: 20px;
    color: var(--primary-color);
    white-space: nowrap;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.menu-item {
    margin-bottom: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.menu-link:hover,
.menu-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.menu-link.logout {
    margin-top: auto;
    color: #ef4444;
}

.menu-link.logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay:target {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal-overlay:target .modal-card {
    transform: translateY(0);
}

.modal-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.modal-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 15px;
}

.btn-later {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-later:hover {
    background: #e2e8f0;
}

/* Data Table Styles */
.table-container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 18px 20px;
    background: var(--primary-light);
    color: #000000;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: var(--text-main);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: #f8fbff;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.action-btns {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.btn-add {
    padding: 6px 14px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.btn-view {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--accent-teal);
    color: var(--white);
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    margin-left: auto;
}

.btn-view:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(20, 184, 166, 0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .dashed-content {
        /* Fix wrapper padding if needed */
        padding: 20px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out, visibility 0.3s;
        z-index: 1001;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        visibility: hidden;
    }

    .sidebar.active {
        transform: translateX(0);
        display: block !important;
        visibility: visible;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .dash-navbar {
        padding: 0 15px;
    }

    .mobile-nav-toggle {
        display: block !important;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        margin-right: 15px;
        background: none;
        border: none;
        color: var(--text-muted);
        z-index: 1002;
    }

    .nav-left {
        gap: 10px;
    }

    .nav-link {
        display: none;
        /* Hide nav links on very small screens if needed, or keep */
    }

    .registration-form,
    .data-table {
        min-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* New responsive rules for forms and lists */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-header h1 {
        font-size: 24px;
    }

    .section-header .btn-add,
    .section-header .btn-view {
        width: auto;
        align-self: flex-end;
        justify-content: center;
    }

    .table-container {
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .data-table {
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 20px;
        background: var(--white);
        border-radius: 12px;
        padding: 20px;
        box-shadow: var(--shadow);
    }

    .data-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
    }

    .data-table td::before {
        content: attr(data-label);
        /* Requires HTML update, or we accept valid layout without labels for now if names are obvious? */
        /* Since I can't easily add data-labels to all HTML without a script or manual edit, and I have many columns.
           I will try a mixed approach or just `text-align: left` and stack them. */
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
    }

    .data-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        gap: 10px;
    }

    /* Better approach without data-labels: Just stack them nicely */
    .data-table td {
        display: block;
        text-align: left;
        padding: 5px 0;
        border: none;
    }

    .data-table td:first-child {
        font-weight: 700;
        color: var(--primary-color);
        font-size: 16px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 10px;
    }

    .action-btns {
        flex-direction: row;
        justify-content: flex-end;
        margin-top: 10px;
        border-top: 1px solid #f0f0f0;
        padding-top: 10px !important;
    }


    .search-box input {
        width: 100%;
        /* Ensure search box doesn't overflow if container shrinks */
        min-width: 150px;
    }
}

@media (max-width: 600px) {
    .nav-center {
        display: block;
        flex: 1;
        margin: 0 10px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        min-width: 0;
        padding: 6px 10px 6px 35px;
        /* Adjust padding for icon */
        font-size: 13px;
    }

    .search-icon {
        width: 16px;
        height: 16px;
        left: 10px;
    }

    .profile-info {
        display: block;
        margin-left: 8px;
    }

    .mobile-hide-text {
        display: none;
    }

    .profile-info h4 {
        font-size: 12px;
        margin: 0;
    }

    .profile-info p {
        display: none;
    }

    .nav-profile {
        gap: 5px;
    }

    .btn-view,
    .btn-add {
        padding: 4px 10px;
        font-size: 11px;
    }

    .registration-form {
        grid-template-columns: 1fr;
    }

    .form-group.full-width,
    .submit-container {
        grid-column: span 1;
    }

    .modal-card {
        width: 95%;
        padding: 20px;
    }
}

/* Mobile Toggle Button (Hidden by default on desktop) */
.mobile-nav-toggle {
    display: none;
}

/* Landing Page Styles */
.landing-body {
    background-color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    margin: 0;
}

.landing-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.landing-image {
    flex: 1.2;
    overflow: hidden;
    position: relative;
}

.landing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.landing-content {
    flex: 0.8;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.dots-pattern {
    position: absolute;
    top: 50px;
    right: 50px;
    width: 300px;
    height: 300px;
    background-image: radial-gradient(#14b8a6 2px, transparent 2px);
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: 0;
    /* Create a fading effect mask */
    mask-image: linear-gradient(to bottom left, black, transparent);
    -webkit-mask-image: linear-gradient(to bottom left, black, transparent);
}

.landing-card {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* Custom Logo Styles */
.logo-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    gap: 5px;
    position: relative;
}

.logo-box {
    display: flex;
    flex-direction: column;
    background: #4ade80;
    /* Fallback */
    background: linear-gradient(135deg, #2dd4bf, #22d3ee);
    padding: 5px 10px;
    border-radius: 4px 15px 4px 15px;
    color: white;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.logo-text-next {
    font-size: 14px;
    letter-spacing: 1px;
}

.logo-text-gen {
    font-size: 14px;
    letter-spacing: 1px;
}

.logo-ehr {
    font-size: 48px;
    font-weight: 900;
    color: #000;
    letter-spacing: -2px;
    line-height: 1;
    margin-left: 5px;
}

.logo-subtext {
    width: 100%;
    font-size: 8px;
    color: #94a3b8;
    letter-spacing: 2px;
    margin-top: 5px;
    text-align: center;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}

.welcome-subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 30px;
}

.btn-login-large {
    background: linear-gradient(90deg, #5eead4, #0ea5e9);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.btn-login-large:hover {
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

/* Responsive adjustments for Landing Page */
@media (max-width: 900px) {
    .landing-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .landing-image {
        height: 40vh;
        flex: none;
    }

    .landing-content {
        flex: 1;
        padding: 40px 20px;
    }

    .dots-pattern {
        top: 20px;
        right: 20px;
        width: 150px;
        height: 150px;
    }


}

/* Login Selection Page Styles */
.landing-card.selection-mode {
    max-width: 800px;
    /* Wider card for two options */
    padding: 60px;
}

.selection-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.selection-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 40px 30px;
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.selection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    background-color: #f0f9ff;
    cursor: pointer;
}

.selection-icon-wrapper {
    width: 100px;
    height: 100px;
    background: #f0f9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.btn-selection {
    width: 100%;
    background: linear-gradient(90deg, #5eead4, #0ea5e9);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.btn-selection:hover {
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

/* Responsive for Selection Page */
@media (max-width: 768px) {
    .selection-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .selection-card {
        width: 100%;
        max-width: 280px;
        padding: 30px 20px;
    }
}