:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.6);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 50px -12px rgba(79, 70, 229, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top left, #e0e7ff 0%, #f8fafc 40%),
        radial-gradient(circle at bottom right, #e0f2fe 0%, #f8fafc 40%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header & Hero */
header {
    padding: 3rem 0;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 0.75rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Search Bar */
.search-container {
    position: sticky;
    top: 2rem;
    z-index: 50;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-input-wrapper {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid white;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper:focus-within {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary);
}

.search-input-wrapper i {
    padding: 0 1rem;
    color: var(--primary);
    font-size: 1.25rem;
}

#doctorSearch {
    width: 100%;
    border: none;
    padding: 0.75rem 0.5rem;
    font-size: 1.125rem;
    outline: none;
    background: transparent;
    color: var(--text);
}

#doctorSearch::placeholder {
    color: #94a3b8;
}

/* Doctor Grid & Cards */
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.doctor-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.doctor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.doctor-card:hover {
    transform: translateY(-10px);
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.doctor-card:hover::before {
    opacity: 1;
}

.doctor-avatar-wrapper {
    margin-right: 0;
    margin-bottom: 1.25rem;
}

.doctor-avatar {
    width: 100px;
    height: 100px;
    border-radius: 2.5rem;
    object-fit: cover;
    background: #eef2ff;
    transition: transform 0.3s;
}

.doctor-card:hover .doctor-avatar {
    transform: scale(1.05);
}

.doctor-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border: 3px solid white;
    border-radius: 50%;
}

.doctor-info {
    flex: 1;
}

.doctor-title {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.doctor-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.doctor-hospital-preview {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.doctor-hospital-preview i {
    margin-right: 0.5rem;
    color: var(--secondary);
}

.doctor-updated-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.doctor-updated-date i {
    margin-right: 0.35rem;
    font-size: 0.7rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 2rem;
    padding: 0;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-content.active {
    transform: translateY(0);
    opacity: 1;
}

.modal-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    height: 120px;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 2rem;
    margin-top: -50px;
    text-align: center;
}

.modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 2rem;
    border: 4px solid white;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.hospital-details {
    text-align: left;
    background: #f8fafc;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.hospital-details h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
}

.hospital-details h3 i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.detail-item {
    display: flex;
    margin-bottom: 1rem;
    gap: 1rem;
}

.detail-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.detail-info {
    flex: 1;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 600;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 640px) {
    header h1 {
        font-size: 2.25rem;
    }

    .container {
        padding: 1rem;
    }

    .doctor-avatar {
        width: 60px;
        height: 60px;
    }
}