/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables for Theming --- */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #495057;
    --white-color: #ffffff;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* --- Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

.content-section {
    padding: 60px 5%;
}

.content-section-light {
    padding: 60px 5%;
    background-color: var(--white-color);
}

/* --- Homepage: Header & Navigation --- */
.site-header {
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-logo .fa-hospital {
    margin-right: 8px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-login-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.nav-login-btn:hover {
    background-color: var(--primary-dark);
}

/* --- Homepage: Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/hero_background.jpg') no-repeat center center/cover;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white-color);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--white-color);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-btn {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 15px 30px;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.hero-btn:hover {
    background-color: #138496;
}

/* --- Homepage: Doctors Section --- */
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.doctor-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doctor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.doctor-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--border-color);
}

.doctor-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.doctor-specialty {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.doctor-location {
    font-size: 0.9rem;
}

/* --- Homepage: Appointment Form --- */
.appointment-form {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.appointment-form input,
.appointment-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.appointment-form .full-width {
    grid-column: 1 / -1;
}

.appointment-form button {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 15px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.appointment-form button:hover {
    background-color: var(--primary-dark);
}

.appointment-confirmation {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background-color: #eaf5ff;
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    text-align: center;
}

/* --- Homepage: Footer --- */
.site-footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 1.5rem 5%;
}

/* --- Chatbot Styles --- */
.chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 35px;
    height: 50px;
    width: 50px;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1001;
    transition: transform 0.3s ease;
}
.chatbot-toggler:hover {
    transform: scale(1.1);
}

.chatbot {
    position: fixed;
    right: 35px;
    bottom: 100px;
    width: 420px;
    background: var(--white-color);
    border-radius: 15px;
    box-shadow: 0 0 128px 0 rgba(0,0,0,0.1), 0 32px 64px -48px rgba(0,0,0,0.5);
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    transform-origin: bottom right;
    z-index: 1000;
}

body.show-chatbot .chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-header {
    padding: 16px 0;
    position: relative;
    text-align: center;
    color: var(--white-color);
    background: var(--primary-color);
    border-radius: 15px 15px 0 0;
}
.chatbot-header h3 { color: var(--white-color); font-size: 1.4rem; }
.close-chatbot { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; }

.chat-log {
    overflow-y: auto;
    height: 310px;
    padding: 30px 20px 100px;
}
.chat-message { display: flex; margin-bottom: 10px; }
.chat-message.bot p { background: #f2f2f2; color: var(--dark-color); border-radius: 10px 10px 10px 0; }
.chat-message.user p { background: var(--primary-color); color: var(--white-color); border-radius: 10px 10px 0 10px; justify-content: flex-end; }
.chat-message p { padding: 12px 16px; font-size: 0.95rem; max-width: 75%; }
.chat-message.user { justify-content: flex-end; }

.suggestion-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 10px; }
.suggestion-buttons button { background: var(--white-color); color: var(--primary-color); border: 1px solid var(--primary-color); padding: 8px 12px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.suggestion-buttons button:hover { background: var(--primary-color); color: var(--white-color); }

.chat-input {
    display: flex;
    gap: 5px;
    position: absolute;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 5px 20px;
    border-top: 1px solid #ddd;
}
.chat-input input { height: 45px; width: 100%; border: none; outline: none; padding: 0 15px; font-size: 1rem; border-radius: 5px; }
.chat-input button { width: 45px; height: 45px; border: none; background: var(--primary-color); color: var(--white-color); cursor: pointer; border-radius: 5px; }

/* --- Login Page --- */
.login-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f0f4f8;
}

.login-wrapper {
    display: flex;
    width: 900px;
    height: 550px;
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.login-branding {
    width: 45%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}
.branding-icon { font-size: 4rem; margin-bottom: 1rem; }
.branding-content h1 { color: var(--white-color); font-size: 1.8rem; }

.login-form-area {
    width: 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header .fa-user-circle { font-size: 3rem; color: var(--primary-color); }
.login-header h2 { margin-top: 0.5rem; }

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}
.input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; }
.input-group input, .input-group select {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.login-btn:hover { background-color: var(--primary-dark); }
.login-btn:disabled { background-color: #aaa; cursor: not-allowed; }

.back-to-website-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 15px;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* --- Dashboard Styles (Admin & Patient) --- */
.dashboard-body { background: #f0f4f8; }

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dark-color);
    color: var(--light-color);
    display: flex;
    flex-direction: column;
}
.sidebar-header { padding: 1.5rem; text-align: center; border-bottom: 1px solid #4a5157; }
.sidebar-header h2 { color: var(--white-color); font-size: 1.2rem; }
.sidebar-menu { flex-grow: 1; margin-top: 1rem; }
.sidebar-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--light-color);
    transition: background 0.3s;
    border-left: 3px solid transparent;
}
.sidebar-menu li a:hover, .sidebar-menu li.active a {
    background: #4a5157;
    border-left-color: var(--primary-color);
}
.sidebar-menu li a i { margin-right: 10px; width: 20px; text-align: center; }
.sidebar-footer { padding: 1.5rem; border-top: 1px solid #4a5157; }

.main-content {
    flex-grow: 1;
    padding: 2rem;
}

.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.header-user img { width: 50px; height: 50px; border-radius: 50%; }

.quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-info h3 { font-size: 1rem; color: var(--text-color); }
.stat-info p { font-size: 2rem; font-weight: 600; color: var(--dark-color); }
.stat-icon { font-size: 2.5rem; padding: 15px; border-radius: 50%; }
.stat-icon.appointments { color: #007bff; background: #e6f2ff; }
.stat-icon.patients { color: #17a2b8; background: #e7f6f8; }
.stat-icon.profile { color: #28a745; background: #e9f6ec; }


.data-card {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.data-card h3 { margin-bottom: 1.5rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
thead th { background-color: #f8f9fa; }
tbody tr:hover { background-color: #f1f1f1; }
.status { padding: 5px 10px; border-radius: 15px; font-size: 0.8rem; font-weight: 600; }
.status.confirmed { background: #eaf7ec; color: #28a745; }
.status.pending { background: #fff8e6; color: #ffc107; }
.status.cancelled { background: #fbebee; color: #dc3545; }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .login-wrapper { flex-direction: column; width: 90%; max-width: 450px; height: auto; }
    .login-branding { display: none; }
    .login-form-area { width: 100%; }
    .container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; }
    .main-content { padding: 1rem; }
}

@media (max-width: 768px) {
    /* --- Styles for Phones --- */
    .nav-menu { 
        display: none; 
    } /* Simplified for this example. A JS-based toggle would be needed for a real site. */
    
    /* Make fonts smaller for better readability */
    .hero-content h1 { 
        font-size: 2.5rem; 
    } /* Reduced from 3.5rem */
    .section-title { 
        font-size: 2rem; 
    } /* Reduced from 2.5rem */

    /* Stack elements instead of side-by-side */
    .appointment-form { 
        grid-template-columns: 1fr; 
    }
    .doctor-grid { 
        grid-template-columns: 1fr; 
    }
    .header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem; 
    }

    /* Adjust chatbot for full width */
    .chatbot { 
        width: 100%; 
        right: 0; 
        bottom: 0; 
        border-radius: 0; 
    }

    /* Reduce padding to create more space */
    .content-section, .content-section-light {
        padding: 40px 5%;
    }
}
