/* Reset and base styles */
* {
    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;
}

/* Ad Banner Styles */
.ad-banner {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
}

.ad-banner.ad-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    margin-top: 20px;
}

/* New Meme Section Above Footer Ad */
.new-meme-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    margin-top: 40px;
}

.new-meme-section .btn-large {
    font-size: 1.2rem;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.new-meme-section .btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

/* Category Buttons Section */
.category-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    margin-top: 20px;
    flex-wrap: wrap;
}

.category-buttons .btn {
    padding: 12px 20px;
    border-radius: 25px;
    border: none !important;
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
    background: transparent !important;
}

/* Trading Button */
.btn-trading {
    background: linear-gradient(135deg, #00d4aa 0%, #0099cc 100%) !important;
}

.btn-trading:hover {
    background: linear-gradient(135deg, #00b894 0%, #0088aa 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 170, 0.3);
}

/* Funny Button */
.btn-funny {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%) !important;
}

.btn-funny:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff8c00 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

/* Wholesome Button */
.btn-wholesome {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%) !important;
}

.btn-wholesome:hover {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 105, 180, 0.3);
}

/* Dank Button */
.btn-dank {
    background: linear-gradient(135deg, #8a2be2 0%, #4b0082 100%) !important;
}

.btn-dank:hover {
    background: linear-gradient(135deg, #7b68ee 0%, #6a5acd 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 43, 226, 0.3);
}

/* Random Button */
.btn-random {
    background: linear-gradient(135deg, #32cd32 0%, #228b22 100%) !important;
}

.btn-random:hover {
    background: linear-gradient(135deg, #228b22 0%, #006400 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(50, 205, 50, 0.3);
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    min-height: 90px;
    width: 728px;
    max-width: 100%;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.ad-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #ffd700;
}

.ad-placeholder span {
    font-weight: 500;
    margin-bottom: 4px;
}

.ad-placeholder small {
    opacity: 0.7;
    font-size: 0.8rem;
}

/* Content Layout */
.content-wrapper {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-sidebar {
    position: sticky;
    top: 20px;
    width: 100%;
}

.ad-sidebar .ad-placeholder {
    width: 160px;
    height: 600px;
    min-height: 600px;
    padding: 15px;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

/* Inline Ad */
.ad-inline {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.ad-inline .ad-placeholder {
    width: 300px;
    height: 250px;
    min-height: 250px;
}

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

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title i {
    color: #ffd700;
    animation: bounce 2s infinite;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* Meme container */
.meme-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

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

.meme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.meme-image-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.meme-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
    transition: transform 0.3s ease;
}

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

.meme-info {
    padding: 25px;
    text-align: center;
}

.meme-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.meme-subreddit {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

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

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

/* Stats */
.stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 500;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item i {
    color: #ffd700;
}

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

.footer p {
    margin-bottom: 5px;
}

.footer i {
    color: #ff6b6b;
    animation: heartbeat 1.5s infinite;
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

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

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

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

/* Responsive design */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        display: none;
    }
    
    .ad-inline {
        order: 1;
    }
    
    .controls {
        order: 2;
    }
    
    .stats {
        order: 3;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .meme-image-container {
        height: 350px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .ad-placeholder {
        width: 100% !important;
        max-width: 320px;
    }
    
    .ad-banner .ad-placeholder {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .meme-image-container {
        height: 250px;
    }
    
    .meme-info {
        padding: 20px;
    }
    
    .meme-title {
        font-size: 1.2rem;
    }
    
    .ad-placeholder {
        padding: 15px;
        font-size: 0.8rem;
    }
    
    .ad-placeholder i {
        font-size: 1.2rem;
    }
}
