/* EasyMed Main Styles */

/* CSS Variables */
:root {
    --primary-cyan: #2563eb;
    --light-cyan: #60a5fa;
    --dark-cyan: #1e3a8a;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #757575;
    --text-dark: #333333;
    --text-light: #666666;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --shadow: rgba(37, 99, 235, 0.1);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f8fffe;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 75px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    border-radius: 16px;
    width: 90%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-sizing: border-box;
}

/* Ensure modal body can expand for validation messages */
.modal-body {
    min-height: 300px;
    box-sizing: border-box;
    overflow: visible;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--primary-cyan);
    color: var(--white);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
    position: relative;
}

.modal-header h2 {
    margin: 0 0 0.4rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.modal-subtitle {
    margin: 0;
    opacity: 0.85;
    font-size: 0.875rem;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--white);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    z-index: 2;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Form Validation Styles */
.form-control:invalid {
    border-color: var(--error);
}

.form-control:invalid:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

/* Prevent layout shift from validation messages */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    /* Prevent flex item from overflowing */
}

/* Custom validation message styling */
.form-control:invalid::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Hide default HTML5 validation bubbles to prevent layout issues */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--white);
    box-sizing: border-box;
    flex: 1;
    min-width: 0;
}

/* Suppress browser validation tooltips that cause layout issues */
.form-control:invalid {
    box-shadow: none;
}

.form-control:-moz-ui-invalid {
    box-shadow: none;
}

.modal .form-group {
    position: relative;
    margin-bottom: 1rem;
}

.modal .input-group {
    position: relative;
    z-index: 1;
}

/* Ensure error state doesn't affect modal layout */
.modal .form-control.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    /* Maintain same dimensions to prevent layout shift */
}

/* Style for error messages below inputs */
.modal .error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: block;
    width: 100%;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: block;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    z-index: 2;
    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-cyan);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-cyan);
}

/* Add extra padding to password inputs to make room for toggle button */
input[type="password"],
input[type="text"]#loginPassword,
input[type="text"]#regPassword,
input[type="text"]#regConfirmPassword {
    padding-right: 3rem !important;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--dark-cyan));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    text-decoration: none;
    color: var(--white);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-cyan);
    border: 2px solid var(--primary-cyan);
}

.btn-secondary:hover {
    background-color: var(--primary-cyan);
    color: var(--white);
    text-decoration: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.w-100 {
    width: 100%;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Role Selection */
.role-selection {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
}

.role-btn:hover {
    border-color: var(--primary-cyan);
    background-color: rgba(37, 99, 235, 0.05);
}

.role-btn.selected {
    border-color: var(--primary-cyan);
    background-color: rgba(37, 99, 235, 0.1);
}

.role-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-cyan);
    font-size: 1.5rem;
}

.role-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.role-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Registration Form Steps */
.form-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.progress-step-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    max-width: 90px;
    position: relative;
}

.progress-step-wrap:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: #e2e8f0;
    transition: background 0.4s ease;
}

.progress-step-wrap.completed::after,
.progress-step-wrap.active::after {
    background: linear-gradient(90deg, #2563eb, #e2e8f0);
}

.progress-step-wrap.completed+.progress-step-wrap::after,
.progress-step-wrap.completed::after {
    background: #2563eb;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.35s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.progress-step.active {
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    color: var(--white);
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    transform: scale(1.1);
}

.progress-step.completed {
    background: #10b981;
    color: var(--white);
    border-color: #6ee7b7;
}

.progress-step-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
    transition: color 0.3s ease;
}

.progress-step-wrap.active .progress-step-label {
    color: #2563eb;
    font-weight: 700;
}

.progress-step-wrap.completed .progress-step-label {
    color: #10b981;
}

.form-step {
    animation: stepSlideIn 0.3s ease;
}

@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header-related responsive rules moved to components/header.css to avoid duplication. */

    .modal-content {
        margin: 10% auto;
        width: 95%;
        min-height: 400px;
        /* Maintain minimum height on mobile */
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }

    .role-selection {
        gap: 0.75rem;
    }

    .role-btn {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.p-1 {
    padding: 1rem;
}

/* Index Page Styles */

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(96, 165, 250, 0.9)),
        url('../images/hero-bg.jpg') center/cover;
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-cyan), var(--light-cyan));
    opacity: 0.9;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--light-cyan));
    border-radius: 2px;
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Doctor Card Styles */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.doctor-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.doctor-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-cyan);
    margin: 0 auto;
}

.doctor-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 1rem 0 0.5rem;
}

.doctor-specialty {
    color: var(--primary-cyan);
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.doctor-schedule {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.schedule-item {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.schedule-item:last-child {
    margin-bottom: 0;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Features and Why Choose Us */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: center;
}

.feature-item {
    margin-bottom: 2rem;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.feature-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.feature-title {
    margin: 0;
    color: var(--primary-cyan);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Call to Action Card */
.cta-card {
    background: linear-gradient(135deg, var(--light-cyan), var(--primary-cyan));
    color: white;
    text-align: center;
    border: none;
}

.cta-card h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.cta-btn {
    background-color: white;
    color: var(--primary-cyan);
    margin-right: 1rem;
    font-weight: 600;
}

.cta-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--dark-cyan);
    transform: translateY(-2px);
}

/* Button Variants */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Responsive Design for Index Page */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .doctors-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .doctor-image {
        width: 100px;
        height: 100px;
    }

    .doctor-name {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .card {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .doctors-grid,
    .services-grid {
        gap: 1rem;
    }
}

/* ===== FOOTER STYLES ===== */
.footer {
    background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--dark-cyan) 100%);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p {
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.5;
}

.footer-section i {
    width: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    padding: 0.3rem 0;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-services p {
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-hours .hours-item {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.footer-hours .hours-item strong {
    color: white;
    display: block;
    margin-bottom: 0.3rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.copyright {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-style: italic;
}

.footer-tagline i {
    color: #ff6b9d;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Footer Responsive Design */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-link {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .footer {
        margin-top: 2rem;
    }

    .footer-section h4 {
        font-size: 1.1rem;
    }

    .footer-section p {
        font-size: 0.9rem;
    }
}