/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language dropdown */
.language-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option:hover {
    background-color: rgba(243, 244, 246, 1);
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(209, 213, 219, 0.8);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* Modal styles */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* Icon button styles */
.icon-btn {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Reaction button styles */
.reaction-btn.active {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.reaction-bounce {
    animation: bounce 0.3s ease;
}

@keyframes bounce {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Ad placeholder styles */
.ad-placeholder {
    background: linear-gradient(
        45deg,
        #f0f0f0 25%,
        #e0e0e0 25%,
        #e0e0e0 50%,
        #f0f0f0 50%,
        #f0f0f0 75%,
        #e0e0e0 75%,
        #e0e0e0
    );
    background-size: 20px 20px;
    animation: move 1s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 20px;
    }
}

/* Content section styles */
.content-section {
    transition: all 0.3s ease;
}

.content-section:hover {
    transform: translateY(-2px);
}

/* Calculator styles */
.calculator-input {
    transition: all 0.2s ease;
}

.calculator-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calculator-btn {
    transition: all 0.2s ease;
}

.calculator-btn:hover {
    transform: translateY(-2px);
}

.calculator-btn:active {
    transform: translateY(0);
}

/* Author bio popbox */
.author-bio-popbox {
    position: absolute;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.author-bio-popbox.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.author-bio-popbox::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.author-name {
    position: relative;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hide-on-tablet {
        display: none;
    }
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }

    /* Mobile layout order */
    .mobile-layout {
        display: flex;
        flex-direction: column;
    }

    .mobile-calculator {
        order: 1;
    }

    .mobile-ad-1 {
        order: 2;
    }

    .mobile-article {
        order: 3;
    }

    .mobile-ad-2 {
        order: 4;
    }

    .mobile-related {
        order: 5;
    }

    .mobile-ad-3 {
        order: 6;
    }

    .mobile-author {
        order: 7;
    }

    /* Adjust popbox for mobile */
    .author-bio-popbox {
        width: 280px;
        left: 50% !important;
        transform: translateX(-50%) translateY(10px);
    }

    .author-bio-popbox.show {
        transform: translateX(-50%) translateY(0);
    }

    .author-bio-popbox::before {
        left: 50%;
        margin-left: -8px;
    }
}

/* Order adjustments */
.order-1 {
    order: 1;
}

.order-2 {
    order: 2;
}

/* Sticky calculator container */
.calculator-container {
    max-width: 310px;
}


/* Ad grid for bottom */
.ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

/* Mobile ad layout */
@media (max-width: 767px) {
    .mobile-ad-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .desktop-layout {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
    }
}
