/* Daily Comics - NewYorker Style Horizontal Scroller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    background-color: #f8f8f8;
    color: #333;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    background-color: #fff;
    border-bottom: 3px solid #000;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.site-info {
    text-align: left;
}

.site-title {
    font-size: 2.2em;
    font-weight: bold;
    color: #000;
    letter-spacing: -1px;
    margin-bottom: 2px;
}

.site-subtitle {
    font-style: italic;
    color: #666;
    font-size: 1em;
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.nav-button:hover {
    background-color: #333;
    transform: translateY(-1px);
}

.nav-button:active {
    transform: translateY(0);
}

.nav-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.comic-counter {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
}

/* Main Container */
.container {
    margin-top: 120px; /* Account for fixed header */
    height: calc(100vh - 120px - 80px); /* Account for header and footer space */
    position: relative;
    overflow: hidden;
    padding-bottom: 20px; /* Extra space above footer */
}

/* Comics Scroller */
.comics-scroller {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 40px 0;
}

.comic-item {
    min-width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 60px;
    position: relative;
}

.comic-content {
    background-color: #fff;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    max-width: 800px;
    width: 100%;
    height: fit-content;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 20px 0;
}

.comic-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
}

.comic-date {
    font-size: 0.85em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.comic-title {
    font-size: 1.3em;
    color: #000;
    font-weight: normal;
    font-style: italic;
}

.comic-image-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    min-height: 0;
    overflow: visible;
    box-sizing: border-box;
}

.comic-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    object-fit: contain;
    margin-bottom: 15px;
    flex: 1;
    min-height: 0;
}

.comic-image:hover {
    transform: scale(1.02);
}

.comic-caption {
    font-style: italic;
    text-align: center;
    color: #555;
    line-height: 1.6;
    font-size: 1.05em;
    max-width: 90%;
    margin: 0 auto 10px auto;
    padding: 10px 15px;
    word-wrap: break-word;
    hyphens: auto;
    flex-shrink: 0;
    overflow-wrap: break-word;
}

/* Social Share Buttons */
.social-share {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 10px 15px;
    margin: 10px auto 0 auto;
    max-width: 90%;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid #ddd;
    font-family: 'Times New Roman', serif;
}

.share-prompt {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    flex-shrink: 0;
}

.share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    background: #f8f8f8;
    border: 1px solid #ccc;
    font-weight: normal;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    height: auto;
    width: auto;
}

.share-btn:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.share-btn i {
    font-size: 14px;
    width: 14px;
    text-align: center;
}

@media (max-width: 480px) {
    .social-share {
        gap: 10px;
        padding: 8px 12px;
        flex-wrap: wrap;
    }
    
    .share-prompt {
        font-size: 11px;
        width: 100%;
        margin-bottom: 5px;
    }
    
    .share-buttons {
        gap: 4px;
        width: 100%;
    }
    
    .share-btn {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .share-btn i {
        font-size: 12px;
    }
}

/* Navigation Arrows */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scroll-arrow:hover {
    background-color: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.1);
}

.scroll-arrow.left {
    left: 20px;
}

.scroll-arrow.right {
    right: 20px;
}

.scroll-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 100;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background-color: #000;
    transform: scale(1.2);
}

.progress-dot:hover {
    background-color: rgba(0,0,0,0.6);
}

/* Loading Animation */
@keyframes slideInFromRight {
    from { 
        opacity: 0; 
        transform: translateX(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideInFromLeft {
    from { 
        opacity: 0; 
        transform: translateX(-50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.comic-content.animate-right {
    animation: slideInFromLeft 0.6s ease forwards;
}

.comic-content.animate-left {
    animation: slideInFromRight 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 1.8em;
    }
    
    .nav-controls {
        gap: 10px;
    }
    
    .nav-button {
        padding: 8px 16px;
        font-size: 0.8em;
    }
    
    .container {
        margin-top: 140px;
        height: calc(100vh - 140px);
    }
    
    .comic-item {
        padding: 0 20px;
    }
    
    .comic-header {
        padding: 20px 20px 10px;
    }
    
    .comic-image-container {
        padding: 20px 20px 15px 20px;
    }
    
    .comic-caption {
        font-size: 1em;
        max-width: 95%;
        padding-bottom: 5px;
    }
    
    .scroll-arrow {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    
    .scroll-arrow.left {
        left: 10px;
    }
    
    .scroll-arrow.right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.6em;
    }
    
    .comic-item {
        padding: 0 10px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    display: none;
}

/* Loading States */
.loading-container,
.error-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container h2 {
    color: #d32f2f;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.error-container p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.retry-button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
}

.retry-button:hover {
    background-color: #333;
}

.no-comics {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    font-size: 1.2em;
    color: #666;
    font-style: italic;
}

/* Image loading states */
.comic-image {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.comic-image[loading] {
    opacity: 0.7;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .comics-scroller {
        transition: none;
    }
    
    .comic-content.animate-right,
    .comic-content.animate-left {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}