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

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a651;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
    --radius: 8px;
    --max-width: 1200px;
    --header-height: 70px;
    
    /* Penang colors */
    --penang-primary: #dc143c;
    --penang-secondary: #ffb700;
    --penang-accent: #1e88e5;
    --penang-bg: #fff5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: none;
    list-style: none;
    gap: 30px;
    align-items: center;
}

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

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

.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 5px 0;
    transition: 0.3s;
}

.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 5px 15px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 30px;
    display: flex;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 16px;
}

.search-btn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #0052a3;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-chip {
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-chip.active,
.filter-chip:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* Main Content Layout */
.main-content {
    padding: 40px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Hospital Listings */
.hospital-listings h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.hospital-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.hospital-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.hospital-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.hospital-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.hospital-info {
    padding: 20px;
}

.hospital-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.hospital-specialty {
    color: var(--text-light);
    margin-bottom: 10px;
}

.hospital-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stars {
    color: #ffd700;
}

.hospital-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-tag {
    padding: 4px 12px;
    background: var(--bg-color);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Sidebar Styles */
.sidebar {
    display: none;
}

.widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.widget h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.procedure-list {
    list-style: none;
}

.procedure-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.procedure-list li:last-child {
    border-bottom: none;
}

.procedure-list a {
    color: var(--text-color);
    text-decoration: none;
}

.procedure-list a:hover {
    color: var(--primary-color);
}

.contact-widget {
    background: var(--primary-color);
    color: var(--white);
}

.contact-widget h3 {
    color: var(--white);
}

.contact-btn {
    width: 100%;
    padding: 12px;
    background: var(--white);
    color: var(--primary-color);
    border: none;
    border-radius: var(--radius);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

.contact-btn:hover {
    transform: scale(1.02);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    padding: 12px 40px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.load-more-btn:hover {
    background: #0052a3;
}

/* Info Section */
.info-section {
    background: var(--white);
    padding: 60px 0;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.8rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.info-card {
    text-align: center;
    padding: 30px 20px;
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.info-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: var(--white);
    padding: 40px 0 20px;
}

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

.footer-column h4 {
    margin-bottom: 15px;
}

.footer-column ul {
    list-style: none;
}

.footer-column a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: block;
    padding: 5px 0;
}

.footer-column a:hover {
    color: var(--white);
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius) 0 0 var(--radius);
}

.newsletter-form button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

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

/* Ad Containers */
.ad-container {
    margin: 20px 0;
    overflow: hidden;
}

.ad-placeholder {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 0;
    text-align: center;
    color: #999;
    border-radius: var(--radius);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Google AdSense styles */
.adsbygoogle {
    background: transparent !important;
}

.ad-banner-top,
.ad-banner-bottom {
    max-width: 970px;
    margin: 20px auto;
}

.ad-banner-top .ad-placeholder,
.ad-banner-bottom .ad-placeholder {
    min-height: 90px;
}

.ad-sidebar .ad-placeholder {
    min-height: 250px;
}

.ad-native {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 30px 0;
    padding: 20px;
}

.ad-native .ad-placeholder {
    min-height: 200px;
    background: transparent;
    border: none;
}

/* Fallback ad styles */
.fallback-ad {
    padding: 20px;
    text-align: center;
}

.fallback-ad .ad-content {
    max-width: 300px;
    margin: 0 auto;
}

.fallback-ad h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.fallback-ad p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.fallback-ad .ad-cta {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.fallback-ad .ad-cta:hover {
    background: #0052a3;
}

/* Responsive ad adjustments */
@media (max-width: 767px) {
    .ad-banner-top,
    .ad-banner-bottom {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .ad-sidebar {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .ad-sidebar.ad-container:first-of-type {
        display: none;
    }
}

/* Tablet Styles */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hospital-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr 300px;
    }
    
    .sidebar-left {
        display: none;
    }
    
    .sidebar-right {
        display: block;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .content-grid {
        grid-template-columns: 200px 1fr 300px;
    }
    
    .sidebar-left {
        display: block;
    }
    
    .hospital-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Menu Overlay */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--white);
        flex-direction: column;
        padding: 30px;
        transition: left 0.3s;
        box-shadow: var(--shadow);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .language-switcher {
        order: -1;
        margin-right: auto;
    }
}

/* Procedures Section */
.procedures-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.procedures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.procedure-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.procedure-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.procedure-card h3 {
    margin: 0 0 0.5rem;
    color: #333;
}

.procedure-card .category {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.procedure-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.procedure-details .cost {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
}

.procedure-details .duration {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
}

.procedure-card .hospitals ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Guides Section */
.guides-section {
    padding: 3rem 0;
}

.guides-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active,
.tab-btn:hover {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.guide-section {
    padding: 2rem 0;
}

.visa-requirements,
.transport-options,
.accommodation-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.requirement-card,
.transport-card,
.accommodation-card,
.insurance-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.checklist-section {
    margin: 2rem 0;
}

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}

.checklist input[type="checkbox"] {
    margin-right: 0.75rem;
}

.culture-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

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

.emergency-card {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 1.5rem;
    border-radius: 8px;
}

/* About Section */
.about-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

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

.about-features .feature {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
}

.modal .close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.modal .close:hover {
    color: #000;
}

.hospital-detail {
    padding: 2rem;
}

.hospital-detail img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.hospital-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.hospital-meta span {
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.detail-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid #e0e0e0;
}

.detail-section:first-of-type {
    border-top: none;
}

.specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.specialty-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: white;
    color: #0066cc;
    border: 2px solid #0066cc;
}

.btn-secondary:hover {
    background: #0066cc;
    color: white;
}

/* Location Selector Styles */
.location-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.location-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.location-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.location-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.location-btn .flag {
    font-size: 1.2rem;
}

/* Penang Mode Styles */
body.penang-mode {
    background-color: var(--penang-bg);
}

body.penang-mode .hero {
    background: linear-gradient(135deg, var(--penang-primary) 0%, var(--penang-secondary) 100%);
}

body.penang-mode .location-btn.active[data-location="penang"] {
    background: var(--penang-primary);
    border-color: var(--penang-primary);
}

body.penang-mode .filter-chip.active {
    background: var(--penang-primary);
}

body.penang-mode .search-btn {
    background: var(--penang-primary);
}

body.penang-mode .search-btn:hover {
    background: #b91c3c;
}

body.penang-mode .load-more-btn {
    background: var(--penang-primary);
}

body.penang-mode .load-more-btn:hover {
    background: #b91c3c;
}

body.penang-mode .contact-btn {
    background: var(--penang-secondary);
    color: var(--text-color);
}

body.penang-mode .contact-btn:hover {
    background: #e6a400;
}

/* Penang Hospital Cards */
.hospital-grid.penang-hospitals .hospital-card {
    border: 2px solid transparent;
    background: white;
    position: relative;
    overflow: visible;
}

.hospital-grid.penang-hospitals .hospital-card::before {
    content: "🇲🇾 Penang";
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--penang-secondary);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.hospital-grid.penang-hospitals .hospital-card:hover {
    border-color: var(--penang-primary);
    transform: translateY(-5px);
}

.hospital-grid.penang-hospitals .feature-tag {
    background: #ffe4e6;
    color: var(--penang-primary);
}

/* Penang Info Section */
body.penang-mode .info-card {
    border-top: 3px solid var(--penang-primary);
}

body.penang-mode .info-icon {
    color: var(--penang-primary);
}

/* Type Selector Styles */
.type-selector {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.type-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.type-btn .icon {
    font-size: 1.2rem;
}

/* Singapore Clinic Styles */
.hospital-grid.singapore-clinics .hospital-card {
    border: 1px solid #e8f5e9;
    background: linear-gradient(to bottom, #ffffff 0%, #f9fdf9 100%);
    position: relative;
}

.hospital-grid.singapore-clinics .hospital-card::before {
    content: "🏢 Clinic";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
}

.hospital-grid.singapore-clinics .hospital-card:hover {
    border-color: #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.hospital-grid.singapore-clinics .feature-tag {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.8rem;
}

.hospital-grid.singapore-clinics .hospital-rating {
    color: #2e7d32;
}

/* Clinic-specific hospital info adjustments */
.hospital-grid.singapore-clinics .hospital-info {
    padding: 1rem;
}

.hospital-grid.singapore-clinics .hospital-specialty {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments for location and type selectors */
@media (max-width: 768px) {
    .location-selector {
        flex-direction: column;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .location-btn {
        width: 200px;
        justify-content: center;
    }
    
    .type-selector {
        flex-direction: column;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .type-btn {
        width: 180px;
        justify-content: center;
    }
}