/* Core Nexis CDN - Main Stylesheet - COMPLETE FIXED VERSION */

:root {
    --primary-color: #fe5940;
    --secondary-color: #000b36;
    --bg-primary: linear-gradient(135deg, var(--secondary-color) 0%, #1a237e 100%);
    --bg-secondary: rgba(255, 255, 255, 0.1);
    --text-primary: white;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --bg-secondary: rgba(0, 0, 0, 0.05);
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: rgba(0, 0, 0, 0.1);
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(254, 89, 64, 0.3);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.nav a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
}

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

.nav a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Header Ad */
.header-ad {
    max-width: 1400px;
    margin: 1rem auto 0;
    padding: 0 2rem;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.header-ad .adsbygoogle {
    display: block;
    margin: 0 auto;
    max-width: 728px;
    min-height: 90px;
    width: 100%;
}

/* Main Container */
.container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

/* Image Section */
.image-section {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

[data-theme="light"] .image-section {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Image Container */
.image-container {
    position: relative;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
    overflow: hidden;
    cursor: zoom-in;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(254, 89, 64, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.main-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 600px;
    display: block;
    transition: all 0.3s ease;
    border-radius: 8px;
    opacity: 0;
    object-fit: contain;
    cursor: zoom-in;
}

.main-image.loaded {
    opacity: 1;
}

.main-image:hover {
    opacity: 0.95;
}

/* CUSTOM ZOOM OVERLAY - COMPLETE REDESIGN */
.custom-zoom-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: zoom-out !important;
    animation: zoomFadeIn 0.3s ease !important;
}

.custom-zoom-image {
    max-width: 95% !important;
    max-height: 95% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    animation: zoomImageIn 0.3s ease !important;
}

.custom-zoom-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    background: rgba(254, 89, 64, 0.9) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    z-index: 1000000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

.custom-zoom-close:hover {
    background: rgba(254, 89, 64, 1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7) !important;
}

/* Hide any medium-zoom overlays */
.medium-zoom-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.image-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
}

.image-error::before {
    content: '📷';
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Latest Update Section - FIXED DARK MODE */
.latest-update-section {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.latest-update-box {
    background: linear-gradient(135deg, #fe5940, #ff7a5c);
    border-radius: 12px;
    margin-top: 35px;
    margin-bottom: 24px;
    box-shadow: 0 8px 25px rgba(254, 89, 64, 0.3);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.latest-update-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(254, 89, 64, 0.4);
}

.update-header {
    background: rgba(0, 11, 54, 0.95);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    flex-wrap: wrap;
}

.update-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #fe5940, #ff7a5c, #fe5940);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.update-icon {
    font-size: 20px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.update-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.update-content {
    padding: 20px;
    background: white;
    color: #333;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.update-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(254, 89, 64, 0.2), transparent);
}

.update-content p {
    margin: 0 0 14px 0;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.update-content p:last-of-type {
    margin-bottom: 18px;
}

.update-content strong {
    color: #fe5940;
    font-weight: 700;
}

.update-date {
    font-size: 13px;
    color: #777;
    font-style: italic;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: 12px;
    position: relative;
    word-wrap: break-word;
}

.update-date::before {
    content: '📅';
    margin-right: 6px;
}

/* FIXED: Dark Mode Styles for Latest Update */
[data-theme="dark"] .latest-update-box {
    box-shadow: 0 8px 25px rgba(254, 89, 64, 0.4);
}

[data-theme="dark"] .latest-update-box:hover {
    box-shadow: 0 12px 35px rgba(254, 89, 64, 0.5);
}

[data-theme="dark"] .update-content {
    background: rgba(0, 11, 54, 0.85) !important;
    color: #fff !important;
}

[data-theme="dark"] .update-content strong {
    color: #ff7a5c !important;
}

[data-theme="dark"] .update-date {
    color: #ccc !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* Info Panel */
.info-panel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    height: fit-content;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

[data-theme="light"] .info-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.info-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--primary-color);
    word-wrap: break-word;
}

.info-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.info-value {
    color: var(--text-secondary);
    word-break: break-all;
    font-size: 0.9rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Actions */
.actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
    margin-bottom: 2rem;
    width: 100%;
}

.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #e54830;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(254, 89, 64, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Download button specific styling */
.download-btn {
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.download-text {
    display: block;
    transition: opacity 0.3s ease;
}

.download-spinner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
}

.download-spinner .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.download-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none !important;
}

.download-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(254, 89, 64, 0.4);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.share-btn {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    min-width: 80px;
    white-space: nowrap;
}

.share-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Sidebar Ad */
.sidebar-ad {
    margin-top: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

[data-theme="light"] .sidebar-ad {
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-ad .adsbygoogle {
    display: block;
    margin: 0 auto;
    width: 300px;
    height: 250px;
    max-width: 100%;
}

/* Error Styles */
.error-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.error-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    max-width: 500px;
    border: 1px solid var(--border-color);
    animation: errorBounce 0.6s ease-out;
    width: 100%;
    word-wrap: break-word;
}

@keyframes errorBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

[data-theme="light"] .error-container {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.error-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    color: var(--primary-color);
    opacity: 0.8;
    animation: errorIconPulse 2s ease-in-out infinite;
}

@keyframes errorIconPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.error-icon svg {
    width: 100%;
    height: 100%;
}

.error-title {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(254, 89,64, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
    word-wrap: break-word;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 2px 10px rgba(254, 89, 64, 0.3); }
    50% { text-shadow: 0 4px 20px rgba(254, 89, 64, 0.6); }
}

.error-message {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    word-wrap: break-word;
}

.error-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
    line-height: 1.6;
    word-wrap: break-word;
}

.error-content {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.loading-spinner {
    position: relative;
    width: 50px;
    height: 50px;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(254, 89, 64, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.redirect-message {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
    text-align: center;
    word-wrap: break-word;
}

.redirect-message span {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.error-actions .btn {
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 200px;
}

.error-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    width: 100%;
    max-width: 100%;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-links a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    word-wrap: break-word;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* CUSTOM ZOOM ANIMATIONS */
@keyframes zoomFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomImageIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes zoomFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes zoomImageOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.5); opacity: 0; }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: calc(100vw - 40px);
    word-wrap: break-word;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .main-image {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Continuing from [data-theme="dark"] .image-container */

[data-theme="dark"] .image-container {
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile notification animations */
@keyframes slideInMobile {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOutMobile {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100%); opacity: 0; }
}

/* Responsive Design - ENHANCED FOR MOBILE */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .header-right {
        gap: 1rem;
        justify-content: center;
        width: 100%;
    }
    
    .nav {
        gap: 1rem;
        justify-content: center;
    }
    
    .image-container {
        max-height: 70vh;
        overflow: hidden;
        width: 100%;
    }
    
    .main-image {
        max-height: 70vh;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    .header-ad {
        padding: 0 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .header-ad .adsbygoogle {
        max-width: 100%;
        min-height: 50px;
        width: 100%;
    }
    
    .footer-links {
        gap: 1rem;
        justify-content: center;
    }
    
    .error-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
        max-width: calc(100% - 2rem);
    }
    
    .error-title {
        font-size: 3rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .error-actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .latest-update-box {
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
    }
    
    .update-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .update-header h3 {
        font-size: 16px;
        flex: 1;
        min-width: 0;
    }
    
    .update-content {
        padding: 16px;
    }
    
    .update-content p {
        font-size: 14px;
    }
    
    .sidebar-ad .adsbygoogle {
        width: 100%;
        height: 200px;
    }
    
    .share-buttons {
        flex-direction: row;
        gap: 0.25rem;
    }
    
    .share-btn {
        font-size: 0.7rem;
        padding: 0.4rem;
        min-width: 60px;
    }
    
    /* Custom zoom overlay adjustments for mobile */
    .custom-zoom-close {
        top: 15px !important;
        right: 15px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
    }
    
    .custom-zoom-image {
        max-width: 98% !important;
        max-height: 98% !important;
    }
    
    /* Mobile notification positioning */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        text-align: center;
        animation: slideInMobile 0.3s ease;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.5rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .image-section,
    .info-panel {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .logo {
        font-size: 1.2rem;
        max-width: 200px;
    }
    
    .nav {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav a {
        font-size: 0.9rem;
        padding: 0.25rem 0.5rem;
    }
    
    .theme-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .share-btn {
        padding: 0.75rem;
        font-size: 0.8rem;
        width: 100%;
    }
    
    .header-ad {
        padding: 0 0.5rem;
    }
    
    .sidebar-ad {
        margin-top: 1rem;
        padding: 0.5rem;
    }
    
    .sidebar-ad .adsbygoogle {
        width: 100%;
        height: 150px;
    }
    
    .error-title {
        font-size: 2.5rem;
    }
    
    .error-message {
        font-size: 1.1rem;
    }
    
    .error-description {
        font-size: 0.9rem;
    }
    
    .update-header {
        padding: 12px 14px;
    }
    
    .update-header h3 {
        font-size: 15px;
    }
    
    .update-content {
        padding: 14px;
    }
    
    .update-content p {
        font-size: 13px;
    }
    
    .update-date {
        font-size: 12px;
    }
    
    .image-container {
        max-height: 60vh;
        min-height: 150px;
    }
    
    .main-image {
        max-height: 60vh;
    }
    
    /* Smaller zoom close button for very small screens */
    .custom-zoom-close {
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .image-container {
        max-height: 80vh;
    }
    
    .main-image {
        max-height: 80vh;
    }
    
    .container {
        gap: 1rem;
    }
    
    .latest-update-box {
        margin-top: 20px;
        margin-bottom: 15px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e54830;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.5);
    }
    
    [data-theme="light"] {
        --border-color: rgba(0, 0, 0, 0.3);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .info-panel,
    .header-ad,
    .sidebar-ad {
        display: none !important;
    }
    
    .container {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0;
    }
    
    .image-section {
        background: none;
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .main-image {
        max-width: 100%;
        height: auto;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* Copy button success state */
.btn-secondary.copied {
    background: #28a745 !important;
    color: white !important;
    transform: scale(1.05);
}

/* Enhanced loading state */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(254, 89, 64, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Smooth transitions for all elements */
* {
    transition: all 0.3s ease;
}

/* Image zoom cursor states */
.main-image {
    cursor: zoom-in;
}

.main-image:hover {
    cursor: zoom-in;
}

/* Enhanced hover effects */
.btn:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
    box-shadow: 0 2px 10px rgba(254, 89, 64, 0.3);
}

/* Loading animation for page */
.container {
    animation: fadeIn 0.5s ease-in-out;
}

/* Enhanced focus states */
.btn:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Improved error page styling */
.error-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(254, 89, 64, 0.1) 0%, transparent 70%);
    z-index: -1;
}

/* Better responsive text sizing */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

/* Enhanced visual feedback */
.btn:active {
    transform: translateY(1px);
}

/* Better loading spinner for large screens */
@media (min-width: 1200px) {
    .image-container.loading::after {
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
        border-width: 4px;
    }
}

/* Improved accessibility for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Additional mobile overflow prevention */
@media (max-width: 768px) {
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .header,
    .container,
    .footer,
    .image-section,
    .info-panel,
    .latest-update-box,
    .update-header,
    .update-content {
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    h1, h2, h3, h4, h5, h6, p, span, div, a {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .btn, .share-btn {
        min-width: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Very small screens (320px and below) */
@media (max-width: 320px) {
    .container {
        padding: 0.25rem;
    }
    
    .image-section,
    .info-panel {
        padding: 0.75rem;
    }
    
    .logo {
        font-size: 1.1rem;
        max-width: 150px;
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .theme-toggle {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .update-header h3 {
        font-size: 14px;
    }
    
    .update-content p {
        font-size: 12px;
    }
    
    .error-title {
        font-size: 2rem;
    }
    
    .main-image {
        max-height: 50vh;
    }
    
    .image-container {
        max-height: 50vh;
        min-height: 120px;
    }
    
    .custom-zoom-close {
        top: 5px !important;
        right: 5px !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
}