/* ========================
   Header Logo
======================== */
header img.logo {
    max-width: 80px; 
    height: auto;    
    margin-right: 10px;
}

/* ========================
   Body
======================== */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #85c6ae;
    color: #333;
    overflow-x: hidden; /* Horizontal scroll fix */
    box-sizing: border-box;
}

/* ========================
   Header
======================== */
header {
    background-color: #85c6ae;
    color: white;
    display: flex;
    align-items: center;
    padding: 15px 10px;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.header-title {
    flex-grow: 1;
    text-align: center;
    font-size: 32px;
    margin: 0;
}

/* ========================
   Footer
======================== */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px 0;
    width: 100%;
    position: relative;
    bottom: 0;
}

.google-ads-container {
    width: 100%;
    max-width: 100vw; /* viewport width fix */
    margin: 0 auto;
    padding: 0; /* remove padding to prevent overflow */
    overflow: hidden;
    box-sizing: border-box;
}

.google-ads-container iframe {
    width: 100% !important;
    max-width: 100%;
    height: auto;
    border: none;
    display: block;
}

/* ========================
   Main Layout
======================== */
main {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    flex-wrap: wrap;
}

.side-nav {
    width: 20%;
    background: #fff;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.side-nav a {
    display: block;
    color: #85c6ae;
    text-decoration: none;
    margin: 10px 0;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.side-nav a:hover {
    background-color: #85c6ae;
    color: white;
}

.content {
    width: 50%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ========================
   Headings & Table
======================== */
h1, h2 {
    color: #333;
    margin: 0;
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #85c6ae;
    color: white;
}

/* ========================
   Responsive Design
======================== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-title {
        font-size: 24px;
        text-align: center;
        margin-top: 10px;
    }

    main {
        flex-direction: column;
    }

    .side-nav {
        width: 100%;
        margin: 10px 0;
    }

    .content {
        width: 100%;
    }

    table {
        font-size: 14px;
    }

    footer {
        padding: 10px 0;
    }

    .google-ads-container {
        max-width: 100vw;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .side-nav {
        width: 100%;
    }

    .content {
        width: 100%;
        padding: 10px;
    }

    header img.logo {
        max-width: 60px;
    }

    .header-title {
        font-size: 20px;
    }

    .google-ads-container {
        max-width: 100vw;
        padding: 0;
    }
}

/* ========================
   RESPONSIVE AD CONTAINERS
======================== */

/* Base ad container - RESPONSIVE */
.ad-responsive-container {
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    padding: 10px;
    text-align: center;
    overflow: hidden;
    display: block !important;
    position: relative;
    min-height: 100px; /* Prevent collapse */
}

/* Ensure ads are visible */
.ad-responsive-container ins {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    min-height: 100px; /* Minimum height */
}

/* Sidebar ads specific */
.side-nav .ad-responsive-container {
    margin: 25px auto;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1px;
}

/* Content ads specific */
.content .ad-responsive-container.content-ad {
    margin: 30px 0;
    background: #f0f7ff;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 20px;
}

/* ========================
   MOBILE SPECIFIC AD STYLES
======================== */
@media (max-width: 768px) {
    /* Mobile ads - full width */
    .ad-responsive-container {
        margin: 15px auto;
        padding: 8px;
        min-height: 90px;
    }
    
    /* Mobile sidebar ads */
    .side-nav .ad-responsive-container {
        margin: 20px auto;
        padding: 12px;
    }
    
    /* Mobile content ads */
    .content .ad-responsive-container.content-ad {
        margin: 25px 0;
        padding: 15px;
    }
    
    /* Ensure ads don't overflow on mobile */
    .ad-responsive-container ins {
        min-height: 90px;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    /* Small mobile adjustments */
    .ad-responsive-container {
        margin: 10px auto;
        padding: 5px;
        min-height: 80px;
    }
    
    .side-nav .ad-responsive-container {
        margin: 15px auto;
        padding: 0px;
    }
    
    .content .ad-responsive-container.content-ad {
        margin: 20px 0;
        padding: 12px;
    }
    
    .ad-responsive-container ins {
        min-height: 80px;
    }
}

/* ========================
   AD VISIBILITY FIXES
======================== */

/* Prevent ad containers from collapsing */
.ad-responsive-container:empty {
    display: none !important;
}

/* Loading state for ads */
.ad-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 100px;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Ad placeholder for slow loading */
.ad-placeholder {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}