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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: white;
}

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

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

.error {
    text-align: center;
    padding: 40px 20px;
    color: white;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    margin: 20px 0;
}

.retry-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.memes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.meme-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.meme-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #f5f5f5;
    transition: opacity 0.3s ease;
}

.meme-image.loading {
    opacity: 0.6;
}

.meme-content {
    padding: 20px;
}

.meme-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3748;
    line-height: 1.4;
}

.meme-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 16px;
    line-height: 1.5;
}

.meme-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #a0aec0;
}

.meme-uses {
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.meme-date {
    color: #718096;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.pagination-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

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

.page-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-weight: 500;
}

.page-info span:first-child {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.page-info span:last-child {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer {
    text-align: center;
    padding: 20px 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-top: 40px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sidebar-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: #e2e8f0;
}

.sidebar-content {
    padding: 0;
}

.carousel-section {
    margin-bottom: 25px;
}

.meme-description-section {
    padding: 0 20px;
    margin-bottom: 25px;
}

.meme-description-section h3 {
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.meme-description-section p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.meme-cta-section {
    padding: 0 20px;
    margin-bottom: 25px;
}

.use-meme-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.use-meme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.use-meme-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.carousel-container {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
    height: 300px;
}

.carousel-image {
    min-width: 100%;
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
    flex-basis: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #2d3748;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    z-index: 2;
}

.carousel-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.carousel-dot.active {
    background: #4299e1;
}

.meme-meta-section {
    border-top: 1px solid #e2e8f0;
    padding: 20px;
    margin-top: 0;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.meta-label {
    color: #718096;
    font-weight: 500;
}

.meta-item span:last-child {
    color: #2d3748;
    font-weight: 600;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .memes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .memes-grid {
        grid-template-columns: 1fr;
    }
    
    .meme-card {
        margin: 0 10px;
    }
    
    .sidebar {
        width: 100%;
        right: -100%;
    }
    
    .carousel-image {
        height: 250px;
    }
    
    .carousel-track {
        height: 250px;
    }
} 