/**
 * UX Features Styles - Similar to Flatsome Theme
 *
 * @package ATH_ATRAHI_DESIGN
 */

/* ==========================================================================
   Social Share Buttons
   ========================================================================== */

.social-share {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-share-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

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

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Social Button Colors */
.share-btn.facebook {
    background: #1877f2;
    color: #ffffff;
}

.share-btn.facebook:hover {
    background: #0d65d9;
}

.share-btn.twitter {
    background: #1da1f2;
    color: #ffffff;
}

.share-btn.twitter:hover {
    background: #0c85d0;
}

.share-btn.linkedin {
    background: #0a66c2;
    color: #ffffff;
}

.share-btn.linkedin:hover {
    background: #084e96;
}

.share-btn.pinterest {
    background: #e60023;
    color: #ffffff;
}

.share-btn.pinterest:hover {
    background: #c7001e;
}

.share-btn.zalo {
    background: #0068ff;
    color: #ffffff;
}

.share-btn.zalo:hover {
    background: #0052cc;
}

.share-btn.messenger {
    background: linear-gradient(135deg, #00b2ff, #006aff);
    color: #ffffff;
}

.share-btn.messenger:hover {
    opacity: 0.9;
}

.share-btn.copy-link {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-btn.copy-link:hover {
    background: rgba(185, 157, 99, 0.2);
    border-color: #b99d63;
    color: #b99d63;
}

.share-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

/* Tooltip */
.share-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.share-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Related Posts
   ========================================================================== */

.related-posts-section {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.related-posts-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: #b99d63;
    margin-bottom: 30px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.related-post-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.4s ease;
}

.related-post-card:hover {
    transform: translateY(-8px);
    border-color: rgba(185, 157, 99, 0.3);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.related-post-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.1);
}

.related-post-content {
    padding: 20px;
}

.related-post-content h4 {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.related-post-card:hover .related-post-content h4 {
    color: #b99d63;
}

.related-post-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==========================================================================
   Table of Contents
   ========================================================================== */

.toc-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(185, 157, 99, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.toc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #b99d63;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(185, 157, 99, 0.2);
    cursor: pointer;
}

.toc-toggle {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(185, 157, 99, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toc-toggle svg {
    color: #b99d63;
    transition: transform 0.3s ease;
}

.toc-container.collapsed .toc-toggle svg {
    transform: rotate(180deg);
}

.toc-container.collapsed .toc-list {
    display: none;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.toc-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: rgba(185, 157, 99, 0.3);
    border-radius: 50%;
    transition: background 0.3s ease;
}

.toc-list li:hover::before {
    background: #b99d63;
}

.toc-list a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.toc-list a:hover {
    color: #b99d63;
    padding-left: 5px;
}

.toc-list ul {
    margin-top: 10px;
    padding-left: 15px;
}

/* ==========================================================================
   Live Search
   ========================================================================== */

.live-search-container {
    position: relative;
}

.live-search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.live-search-form:focus-within {
    border-color: #b99d63;
    box-shadow: 0 0 0 3px rgba(185, 157, 99, 0.1);
}

.live-search-input {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14px;
}

.live-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.live-search-input:focus {
    outline: none;
}

.live-search-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.live-search-btn svg {
    color: #b99d63;
    transition: transform 0.3s ease;
}

.live-search-btn:hover svg {
    transform: scale(1.1);
}

/* Search Results Dropdown */
.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.live-search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item-live {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: background 0.3s ease;
}

.search-result-item-live:last-child {
    border-bottom: none;
}

.search-result-item-live:hover {
    background: rgba(185, 157, 99, 0.1);
}

.search-result-thumb {
    width: 60px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info h4 {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.search-result-item-live:hover .search-result-info h4 {
    color: #b99d63;
}

.search-result-info span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.search-loading,
.search-no-results {
    padding: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.search-loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(185, 157, 99, 0.3);
    border-top-color: #b99d63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, #b99d63, #9a7d44);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ==========================================================================
   Post Views & Reading Time
   ========================================================================== */

.post-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-stat svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Newsletter Popup
   ========================================================================== */

.newsletter-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.newsletter-popup {
    background: linear-gradient(135deg, #1a1a1a, #232323);
    border: 1px solid rgba(185, 157, 99, 0.3);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.newsletter-popup-overlay.active .newsletter-popup {
    transform: scale(1);
}

.newsletter-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.newsletter-popup-content {
    text-align: center;
}

.newsletter-popup-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(185, 157, 99, 0.1);
    border-radius: 50%;
    margin: 0 auto 25px;
}

.newsletter-popup-icon svg {
    width: 40px;
    height: 40px;
    color: #b99d63;
}

.newsletter-popup h3 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 15px;
}

.newsletter-popup p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
}

.newsletter-popup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.newsletter-popup-form input {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
}

.newsletter-popup-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-popup-form button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #b99d63, #9a7d44);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-popup-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(185, 157, 99, 0.3);
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #b99d63, #9a7d44);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(185, 157, 99, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(185, 157, 99, 0.4);
}

/* ==========================================================================
   Cost Calculator Widget
   ========================================================================== */

.cost-calculator {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(185, 157, 99, 0.3);
    border-radius: 16px;
    padding: 30px;
}

.cost-calculator h3 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #b99d63;
    margin-bottom: 25px;
    text-align: center;
}

.calc-field {
    margin-bottom: 20px;
}

.calc-field label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
}

.calc-field select,
.calc-field input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
}

.calc-field select {
    cursor: pointer;
}

.calc-field input:focus,
.calc-field select:focus {
    outline: none;
    border-color: #b99d63;
}

.calc-result {
    background: linear-gradient(135deg, rgba(185, 157, 99, 0.2), rgba(185, 157, 99, 0.1));
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin-top: 25px;
}

.calc-result-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 10px;
}

.calc-result-value {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    color: #b99d63;
    font-weight: 700;
}

.calc-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #b99d63, #9a7d44);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.calc-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(185, 157, 99, 0.3);
}

/* ==========================================================================
   Sticky Header
   ========================================================================== */

.site-header.scrolled {
    background: rgba(26, 26, 26, 0.98);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Image Lightbox
   ========================================================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .social-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
    
    .newsletter-popup {
        padding: 30px 20px;
    }
    
    .newsletter-popup h3 {
        font-size: 24px;
    }
    
    .cost-calculator {
        padding: 20px;
    }
    
    .calc-result-value {
        font-size: 28px;
    }
    
    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 45px;
        height: 45px;
    }
}
