:root {
    --primary-color: #fe5940;
    --font-family: 'Jost', serif;
    --secondary-color: #000b36;
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --secondary-color: #000b36;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
.header {
    background-color: #ffffff !important; /* Always white background */
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

/* Ensure header stays white in dark mode */
[data-theme="dark"] .header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e0e0e0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Ad Container Styles */
.ad-container {
    width: 100%;
    min-height: 90px;
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-container .adsbygoogle {
    width: 100%;
    max-width: 100%;
}

/* Hide ad container if ad is blocked */
.ad-container:empty,
.ad-container.hidden {
    display: none;
}

/* Ensure ads are responsive */
ins.adsbygoogle {
    background-color: transparent !important;
    max-width: 100% !important;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

.image-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.main-image {
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: block;
}

.main-image:hover {
    transform: scale(1.02);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.info-card, .latest-update, .action-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    width: 100%;
}

.info-card h3, .latest-update h3, .action-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-color);
}

.info-value {
    color: var(--text-color);
    opacity: 0.8;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}

.action-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
}

.action-btn.download {
    background-color: var(--primary-color);
    color: white;
}

.action-btn.copy-url {
    background-color: var(--secondary-color);
    color: white;
}

.action-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.action-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Share Options */
.share-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.share-btn.facebook { background-color: #1877f2; color: white; }
.share-btn.twitter { background-color: #1da1f2; color: white; }
.share-btn.whatsapp { background-color: #25d366; color: white; }
.share-btn.reddit { background-color: #ff4500; color: white; }
.share-btn.telegram { background-color: #0088cc; color: white; }
.share-btn.linkedin { background-color: #0077b5; color: white; }

.share-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Latest Update Section */
.update-content {
    color: var(--text-color);
    opacity: 0.9;
}

/* Security Info */
.security-info {
    background: linear-gradient(135deg, var(--primary-color), #ff7961);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    text-align: center;
    width: 100%;
}

.security-info h3 {
    margin-bottom: 1rem;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
        width: 100%;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
    }

    .header {
        padding: 0.75rem 0;
    }

    .header-content {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        padding: 0;
        justify-content: space-between;
    }

    .logo-container {
        flex-shrink: 0;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .nav-menu {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .nav-links {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: nowrap;
    }

    .nav-link {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .theme-toggle {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
        white-space: nowrap;
    }

    /* Mobile ad adjustments */
    .ad-container {
        min-height: 60px;
        padding: 0.75rem;
        margin: 1rem 0;
    }
    
    /* Sidebar ad moves to bottom on mobile */
    #sidebarAdContainer {
        order: 2;
    }

    .share-options {
        flex-direction: column;
    }

    .share-btn {
        flex: none;
        width: 100%;
    }

    .action-buttons {
        gap: 0.5rem;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .modal-content {
        max-width: 90vw;
        max-height: 90vh;
    }

    .modal-image {
        max-width: 90%;
        max-height: 90%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
        width: 100%;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 1.1rem;
    }

    .theme-toggle {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }

    .header-content {
        padding: 0 2px;
    }

    .nav-menu {
        gap: 0.8rem;
    }
    
    /* Ensure ads don't overflow on small screens */
    .ad-container {
        padding: 0.5rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: var(--secondary-color);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Ensure proper ad spacing in dark mode */
[data-theme="dark"] .ad-container {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Prevent ad layout shift */
.ad-container:not(:empty) {
    min-height: 90px;
}

@media (max-width: 768px) {
    .ad-container:not(:empty) {
        min-height: 60px;
    }
}