/*
Theme Name: Astra Child - GiftAcc Blog
Theme URI: https://blog.giftacc.ir
Description: قالب سفارشی بلاگ گیفتک با طراحی مدرن، تم تیره/روشن و بهینه‌سازی کامل
Author: GiftAcc Team
Author URI: https://giftacc.ir
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
*/

/* ============================================
   فونت‌های سفارشی
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ============================================
   متغیرهای CSS (رنگ‌بندی - Spotify Style)
   ============================================ */
:root {
    /* رنگ‌های Spotify */
    --spotify-green: #1DB954;
    --spotify-green-dark: #1ed760;
    --spotify-green-darker: #169c46;
    --spotify-black: #121212;
    --spotify-dark-gray: #181818;
    --spotify-medium-gray: #282828;
    --spotify-light-gray: #b3b3b3;
    
    /* رنگ‌های اصلی */
    --primary-color: #1DB954;
    --primary-hover: #1ed760;
    --primary-active: #169c46;
    
    /* پس‌زمینه‌ها */
    --bg-primary: #121212;
    --bg-secondary: #181818;
    --bg-card: #282828;
    --bg-hover: #3e3e3e;
    
    /* متن‌ها */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #a7a7a7;
    --text-disabled: #6a6a6a;
    
    /* مرزها */
    --border-color: #282828;
    --border-hover: #3e3e3e;
    
    /* شادوها */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-green: 0 4px 20px rgba(29, 185, 84, 0.3);
    
    /* فونت‌ها */
    --font-primary: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Inter', 'Vazirmatn', sans-serif;
    
    /* اندازه‌ها */
    --header-height: 70px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition-speed: 0.2s;
}

/* ============================================
   تنظیمات پایه
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    scroll-behavior: smooth;
    background: #121212 !important;
}

html body {
    background: #121212 !important;
}

body {
    font-family: var(--font-primary) !important;
    font-size: 1.6rem;
    line-height: 1.8;
    color: var(--text-primary) !important;
    background: #121212 !important;
    background-color: #121212 !important;
    transition: background var(--transition-speed), color var(--transition-speed);
    direction: rtl;
    text-align: right;
}

/* Override Astra theme */
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single,
.ast-separate-container .comment-respond,
body,
body.ast-separate-container {
    background: #121212 !important;
    background-color: #121212 !important;
}

#page {
    background: #121212 !important;
}

.site {
    background: #121212 !important;
}

/* انیمیشن smooth برای تم */
body, .site-header, .site-content, .site-footer, .blog-card {
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
}

/* Override all Astra containers */
.site-content,
.ast-container,
.site-main,
article,
.entry-content,
.ast-separate-container .site-main > .ast-row {
    background: transparent !important;
    background-color: transparent !important;
}

/* Ensure all content areas are dark */
main,
#content,
#primary {
    background: transparent !important;
}

/* پنهان کردن دکمه scroll-to-top پیش‌فرض تم Astra */
#ast-scroll-top {
    display: none !important;
}

/* دکمه Scroll to Top سفارشی */
.custom-scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #000;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.custom-scroll-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.custom-scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 24px rgba(29, 185, 84, 0.6);
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

.custom-scroll-to-top:active {
    transform: translateY(-3px) scale(1.05);
}

.custom-scroll-to-top svg {
    width: 24px;
    height: 24px;
    fill: #000;
}

/* موبایل */
@media (max-width: 768px) {
    .custom-scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        left: 20px;
        font-size: 1.8rem;
    }
    
    .custom-scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   تایپوگرافی
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

h1 { font-size: clamp(3.2rem, 5vw, 5.6rem); }
h2 { font-size: clamp(2.8rem, 4vw, 4.2rem); }
h3 { font-size: clamp(2.4rem, 3vw, 3.2rem); }
h4 { font-size: 2.4rem; }
h5 { font-size: 2rem; }
h6 { font-size: 1.8rem; }

p {
    margin-bottom: 1.6rem;
    line-height: 1.9;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

/* ============================================
   دکمه‌ها (Spotify Style)
   ============================================ */
.btn {
    display: inline-block;
    padding: 1.2rem 3.2rem;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 500px;
    transition: all var(--transition-speed);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--spotify-black);
    box-shadow: var(--shadow-green);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(29, 185, 84, 0.4);
}

.btn-primary:active {
    background: var(--primary-active);
    transform: scale(1);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    transform: scale(1.04);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    border-color: var(--primary-hover);
    color: var(--primary-hover);
    transform: scale(1.04);
}

/* ============================================
   Scrollbar Styling (Spotify Style)
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* ============================================
   کارت‌ها (Spotify Style)
   ============================================ */
.glass-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: all var(--transition-speed);
}

.glass-card:hover {
    background: var(--bg-hover);
}

/* ============================================
   Utility Classes
   ============================================ */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }
.mt-5 { margin-top: 5rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }
.mb-5 { margin-bottom: 5rem; }

.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 55%;
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 50%;
    }
}

/* ============================================
   انیمیشن‌ها
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ============================================
   Force Dark Background (Spotify Style)
   ============================================ */
html,
html body,
body.home,
body.blog,
body.single,
body.archive,
body.category,
body.ast-separate-container,
body.ast-two-container,
#page,
.site,
.site-content,
.ast-container,
#content,
#primary,
.site-main,
main {
    background: #121212 !important;
    background-color: #121212 !important;
}

/* Override Astra article backgrounds */
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-article-single,
.ast-separate-container .site-main > .ast-row,
.ast-article-inner,
article,
.entry-content,
.ast-author-box,
.ast-404-layout-1,
.no-results,
.ast-archive-description,
.comments-area,
.comment-respond,
.ast-row,
.ast-col-md-12,
.ast-separate-container .ast-comment-list li.depth-1 {
    background: transparent !important;
    background-color: transparent !important;
}

/* Ensure wrapper has dark background */
#wrapper,
.ast-wrapper {
    background: #121212 !important;
}

/* Comments area specific */
.ast-separate-container .comments-title,
.ast-separate-container .comments-count-wrapper {
    background: transparent !important;
}

/* ============================================
   Mobile Responsive Fixes
   ============================================ */

/* Prevent horizontal scroll on mobile */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

body {
    max-width: 100vw !important;
    overflow-x: clip;
}

/* Ensure all elements fit within viewport */
* {
    max-width: 100%;
}

img {
    max-width: 100% !important;
    height: auto !important;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    body {
        font-size: 1.5rem;
    }
    
    .container {
        padding-right: 1.5rem !important;
        padding-left: 1.5rem !important;
    }
    
    /* Prevent tables from overflowing */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Ensure pre and code blocks don't overflow */
    pre,
    code {
        overflow-x: auto;
        max-width: 100%;
        word-wrap: break-word;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 1.4rem;
    }
    
    .container {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
}

/* Hide only truly empty comment sections */
.comments-area:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Keep comment form visible even if it's the only child */
.comment-respond {
    display: block !important;
}
