/* EasyMed Main Styles */

/* CSS Variables */
:root {
    --primary-cyan: #00bcd4;
    --light-cyan: #4dd0e1;
    --dark-cyan: #0097a7;
    --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(0, 188, 212, 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: 12px;
    width: 90%;
    max-width: 500px;
    min-height: 400px; /* Ensure minimum height */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    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(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-cyan), var(--light-cyan));
    color: var(--white);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.modal-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.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(0, 188, 212, 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: 2.5rem; /* Extra space for error messages below inputs */
}

.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(0, 188, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 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(0, 188, 212, 0.05);
}

.role-btn.selected {
    border-color: var(--primary-cyan);
    background-color: rgba(0, 188, 212, 0.1);
}

.role-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 188, 212, 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;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.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: 600;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--primary-cyan);
    color: var(--white);
}

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

@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(0, 188, 212, 0.95), rgba(77, 208, 225, 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(0, 188, 212, 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;
    }
}
