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

/* navigation */
.site-nav {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: border-bottom 0.2s ease;
}

.site-nav.scrolled {
    border-bottom: 1px solid #e2e8f0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link.active {
    color: #3b82f6;
    font-weight: 600;
}

.nav-search {
    flex: 1;
    max-width: 320px;
    margin: 0 1.5rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-search:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

.nav-search::placeholder {
    color: #94a3b8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

.flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.flag-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 150px;
}

.flag-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* placeholder flag card styles */
.flag-card-placeholder {
    opacity: 0.7;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
}

.flag-card-placeholder:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* new card content layout */
.flag-card-content {
    position: relative;
    padding: 1rem;
    min-height: 150px;
}

/* flag in top right corner */
.flag-corner-image {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    /* border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

/* placeholder flag in top right corner */
.flag-corner-placeholder {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 56px;
    height: 56px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-placeholder-icon {
    font-size: 1.4rem;
    opacity: 0.6;
}

/* updated flag info positioning */
.flag-info {
    padding-right: 70px; /* Leave space for larger flag */
}

.country-code {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.country-name {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.api-url {
    font-size: 0.75rem;
    color: #8b5cf6;
    background: #f3f4f6;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.placeholder-note {
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
}

.copy-notification {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    background: #fff;
    color: #1e293b;
    padding: 0.9rem 1.1rem 0.9rem 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #10b981;
    transform: translateX(calc(100% + 28px));
    transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
    z-index: 2000;
    max-width: 300px;
    min-width: 240px;
}

.copy-notification.show {
    transform: translateX(0);
}

.copy-notification-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.copy-notification-flag {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-left: 0.42rem;
}

.copy-notification-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-notification-sub {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    word-break: break-all;
}

.copy-notification-link {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
}

.copy-notification-link:hover {
    text-decoration: underline;
}

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.footer-meta {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.85;
}

.footer a {
    color: inherit;
}

.footer a:hover {
    color: #3b82f6;
}

/* API docs */
.doc-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.doc-section {
    margin-top: 2rem;
}

.doc-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.doc-section p {
    color: #475569;
    margin-bottom: 0.75rem;
}

.doc-list {
    margin: 0.5rem 0 0.75rem 1.25rem;
    color: #475569;
}

.doc-pre {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    margin: 0.5rem 0 0.75rem;
}

.doc-pre code {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #1e293b;
}

.doc-pre-json code {
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre;
}

.doc-section code {
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
    background: #f1f5f9;
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.doc-table th,
.doc-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.doc-table th {
    color: #64748b;
    font-weight: 600;
}

.doc-table td {
    color: #475569;
}

/* filter button hover effects */
.filter-btn:hover {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

.filter-btn.active {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

/* mobile optimizations */
@media (max-width: 768px) {
    .flags-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }

    .flag-card {
        min-height: 130px;
    }

    .flag-card-content {
        padding: 0.75rem;
        min-height: 130px;
    }

    .flag-corner-image,
    .flag-corner-placeholder {
        width: 48px;
        height: 48px;
        top: 0.5rem;
        right: 0.5rem;
    }

    .flag-info {
        padding-right: 58px;
    }

    .country-code {
        font-size: 1.1rem;
    }

    .country-name {
        font-size: 0.85rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .flags-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .flag-corner-image,
    .flag-corner-placeholder {
        width: 40px;
        height: 40px;
    }

    .flag-info {
        padding-right: 48px;
    }
}

/* scroll up widget */
.scroll-up-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 3rem;
    height: 3rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scroll-up-widget.visible {
    opacity: 0.9;
    visibility: visible;
}

.scroll-up-widget:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.scroll-arrow {
    color: #64748b;
    font-size: 1.5rem;
    font-weight: bold;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* countries table styles */
.countries-table-container {
    margin-bottom: 3rem;
    overflow-x: auto;
}

#countriesTable {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#countriesTable tbody tr {
    transition: background-color 0.2s ease;
}

#countriesTable tbody tr:hover {
    background-color: #f8fafc;
}

#countriesTable tbody tr td button {
    transition: background-color 0.2s ease;
}

#countriesTable tbody tr td button:hover {
    background-color: #2563eb !important;
}

/* timezones table styles */
.timezones-table-container {
    margin-bottom: 3rem;
    overflow-x: auto;
}

#timezonesTable {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#timezonesTable tbody tr {
    transition: background-color 0.2s ease;
}

#timezonesTable tbody tr:hover {
    background-color: #f8fafc;
}

/* mobile navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        height: 3.5rem;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .nav-search {
        max-width: 140px;
        margin: 0 0.75rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.65rem;
    }
}

/* mobile adjustments for table */
@media (max-width: 768px) {
    .countries-table-container,
    .timezones-table-container {
        font-size: 0.9rem;
    }

    #countriesTable th,
    #countriesTable td,
    #timezonesTable th,
    #timezonesTable td {
        padding: 0.75rem 0.5rem;
    }

    #countriesTable tbody tr td button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

        /* hide less critical columns on mobile for timezones */
    @media (max-width: 640px) {
        #timezonesTable th:nth-child(6),
        #timezonesTable td:nth-child(6) {
            display: none;
        }
    }
}

/* mobile adjustments for scroll widget */
@media (max-width: 768px) {
    .scroll-up-widget {
        right: 1.5rem;
        bottom: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }

    .scroll-arrow {
        font-size: 1.3rem;
    }
}

/* atmofeed */
.nav-search-form {
    flex: 1;
    max-width: 420px;
    margin: 0 1.5rem;
}

.nav-search-form .nav-search {
    width: 100%;
    max-width: none;
    margin: 0;
}

.hero-intro {
    margin-bottom: 1.5rem;
    color: #64748b;
    font-size: 1rem;
}

.weather-layout {
    margin-bottom: 2rem;
}

.weather-card {
    cursor: default;
}

.weather-card.hidden {
    display: none;
}

.weather-card:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.weather-card-content {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.25rem 1.5rem 1rem;
    flex-wrap: wrap;
}

.weather-primary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.weather-temp-block {
    min-width: 0;
}

.weather-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 72px;
}

.weather-temp {
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 700;
    color: #1e293b;
}

.weather-context {
    flex: 1 1 200px;
    min-width: 0;
}

.weather-location-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.location-maps-link {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    text-decoration: none;
    flex-shrink: 0;
}

.location-maps-link:hover {
    color: #3b82f6;
}

.location-maps-link.hidden {
    display: none;
}

.location-maps-icon {
    display: block;
}

.weather-location {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.weather-unit-toggle {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
}

.weather-unit-toggle button {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: #64748b;
    cursor: pointer;
}

.weather-unit-toggle button.active {
    color: #3b82f6;
    font-weight: 600;
}

.weather-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.weather-condition {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.weather-context .api-url {
    margin-bottom: 0;
}

.weather-stats {
    list-style: none;
    flex: 0 0 auto;
    min-width: 150px;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
}

.weather-stats li + li {
    margin-top: 0.1rem;
}

.weather-extra {
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #64748b;
}

.weather-country-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.weather-country-flag.hidden {
    display: none;
}

.weather-extra span {
    display: inline-block;
    margin-right: 1rem;
}

.response-section {
    margin-bottom: 3rem;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #64748b;
    font-size: 0.9rem;
    min-height: 1.25rem;
}

.status-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: status-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.status-spinner.hidden {
    display: none;
}

@keyframes status-spin {
    to {
        transform: rotate(360deg);
    }
}

.status.error {
    color: #ef4444;
}

.json-panel {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.json-panel pre {
    margin: 0;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: visible;
}

.weekly-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.weekly-header.hidden {
    display: none;
}

.weekly-location-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.weekly-location {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.weekly-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.weekly-day-card {
    cursor: default;
}

.weekly-day-card:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.weekly-day-card-today {
    box-shadow: 0 0 0 2px #3b82f6;
}

.weekly-day-content {
    padding: 1rem 0.75rem;
    text-align: center;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.weekly-day-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.weekly-day-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.weekly-day-condition {
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.3;
    min-height: 2.6em;
}

.weekly-day-temp {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.weekly-day-temp-low {
    font-weight: 500;
    color: #64748b;
}

@media (max-width: 768px) {
    .nav-search-form {
        max-width: 140px;
        margin: 0 0.75rem;
    }

    .weather-card-content {
        gap: 1.25rem;
        padding: 1rem;
    }

    .weather-icon {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .weather-temp {
        font-size: 1.75rem;
    }

    .weather-stats {
        width: 100%;
        min-width: 0;
    }

    .weather-extra {
        padding: 0.75rem 1rem 1rem;
    }

    .weekly-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weekly-day-content {
        min-height: 160px;
        padding: 0.85rem 0.5rem;
    }

    .weekly-day-icon {
        width: 48px;
        height: 48px;
    }
}