/* فونت‌ها */
@font-face {
    font-family: 'me_quran';
    src: url('../fonts/me_quran/me_quran.eot');
    src: url('../fonts/me_quran/me_quran.eot?#iefix') format('embedded-opentype'),
         url('../fonts/me_quran/me_quran.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iran_yekan/IRANYekanWebThin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iran_yekan/IRANYekanWebLight.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iran_yekan/IRANYekanWebRegular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iran_yekan/IRANYekanWebMedium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('../fonts/iran_yekan/IRANYekanWebBold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* تنظیمات کلی */
* {
    box-sizing: border-box;
}

body {
    font-family: 'IRANYekan', Tahoma, sans-serif;
    font-weight: 300;
    direction: rtl;
    background: #f8f6f3;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* متن عربی */
.arabic-text {
    font-family: 'me_quran', Tahoma, sans-serif;
    color: #5e2901;
    font-size: 1.5rem;
    line-height: 2.5;
    word-spacing: 4px;
    text-align: justify;
    text-align-last: right;
}

/* متن فارسی */
.persian-text {
    font-family: 'IRANYekan', Tahoma, sans-serif;
    font-weight: 300;
    color: #5e5e5e;
    font-size: 0.9rem;
    line-height: 1.9;
    text-align: justify;
    text-align-last: right;
}

/* هدر */
.site-header {
    background: linear-gradient(135deg, #1a5e3a 0%, #0d3320 100%);
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.site-header a {
    color: white;
    text-decoration: none;
}

.site-title-link {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

.site-title-sub {
    font-size: 0.6em;
    font-weight: 300;
    color: #a0d8b4;
}

/* ناوبری بین صفحات */
.header-nav {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.header-nav-item {
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    transition: all 0.2s;
}

.header-nav-item.active {
    background: rgba(255,255,255,0.25);
    color: white;
}

.header-nav-item:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* کارت صفحه اصلی */
.card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card-title {
    font-weight: 500;
    font-size: 1.2rem;
    color: #1a5e3a;
    margin-bottom: 0.5rem;
}

/* عنوان صفحه داخلی */
.page-title {
    font-weight: 500;
    font-size: 1.15rem;
    color: #1a5e3a;
    text-align: center;
    margin: 0.5rem 0 0.75rem;
}

/* آمار مینیمال */
.stats-compact {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    font-size: 0.8rem;
    color: #777;
}

.stats-compact-progress {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stats-compact-sep {
    color: #ccc;
    font-size: 0.85rem;
}

.stats-compact-target {
    color: #aaa;
    font-size: 0.85rem;
}

.stats-compact-remaining {
    font-size: 0.75rem;
    color: #b08d57;
    white-space: nowrap;
}

.stats-compact-row {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.75rem;
}

.stats-compact-row strong {
    color: #1a5e3a;
    font-weight: 500;
}

/* Progress bar */
.progress-wrap {
    background: #e8e4df;
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.progress-bar {
    background: linear-gradient(90deg, #1a5e3a, #2ecc71);
    height: 100%;
    border-radius: 50px;
    transition: width 0.6s ease;
    min-width: 0;
}

/* آمار */
.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
}

.stat-number {
    font-weight: 500;
    color: #1a5e3a;
    font-size: 1rem;
}


/* مینی پلیر فیکس */
.mini-player {
    position: fixed;
    bottom: 5.5rem;
    left: 0;
    right: 0;
    z-index: 98;
    background: #2c2c2c;
    padding: 1rem 1rem 0.85rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    direction: ltr;
}

.mini-player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.mini-player-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
}

.mini-player-track {
    flex: 1;
    min-width: 0;
}

.mini-player-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    direction: rtl;
}

.mini-player-progress-wrap {
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    height: 6px;
    overflow: hidden;
    cursor: pointer;
}

.mini-player-progress {
    background: #b08d57;
    height: 100%;
    border-radius: 50px;
    width: 0;
    transition: width 0.2s linear;
}

.mini-player-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    margin-top: 0.25rem;
}

.mini-player-close {
    position: absolute;
    top: 0.3rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

.mini-player-close:hover {
    color: white;
}

/* دکمه ثبت قرائت - فیکس پایین صفحه */
.fixed-record-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: white;
    padding: 0.6rem 1rem;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.btn-record {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, #1a5e3a 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'IRANYekan', Tahoma, sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-record:active {
    transform: scale(0.97);
}

.btn-record:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* پیام مینیمال زیر دکمه */
.record-feedback {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    height: 1rem;
    transition: opacity 0.3s;
    color: #1a5e3a;
}

.record-feedback.info {
    color: #b08d57;
}

/* فاصله پایین محتوا برای دکمه فیکس */
body.has-fixed-bar main {
    padding-bottom: 5rem;
}

/* Collapse sections */
.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #f0ece7;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
    user-select: none;
}

.collapse-header:hover {
    background: #e8e4df;
}

.collapse-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #444;
}

.collapse-icon {
    transition: transform 0.3s;
    font-size: 0.8rem;
    color: #999;
}

.collapse-header.active .collapse-icon {
    transform: rotate(180deg);
}

.collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.collapse-content.open {
    max-height: 50000px;
    overflow: visible;
}

.collapse-content-inner {
    padding: 1rem;
    background: white;
    border-radius: 0 0 12px 12px;
}

/* آیه / فراز */
.verse-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0ece7;
}

.verse-item:last-child {
    border-bottom: none;
}

.verse-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #d5cfc7;
    color: #8a8275;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 500;
    margin-left: 0.4rem;
    margin-top: 1.2rem;
    flex-shrink: 0;
    font-family: 'IRANYekan', Tahoma, sans-serif;
}

/* پلیر */
.player-section {
    margin: 0.75rem 0;
}

.player-label {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.5rem;
}

/* Container */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem;
}

/* لینک کارت */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.header-inner {
    max-width: 640px;
    margin: 0 auto;
}


/* Honeypot */
.hp-field {
    display: none;
}

/* پنل ادمین */
.admin-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f6f3;
    font-weight: 500;
    color: #555;
}

.btn-admin {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #1a5e3a;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'IRANYekan', Tahoma, sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-admin:hover {
    background: #155030;
}

.btn-danger {
    background: #c0392b;
}

.btn-danger:hover {
    background: #a93226;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'IRANYekan', Tahoma, sans-serif;
    font-size: 0.9rem;
    direction: rtl;
}

.form-input:focus {
    outline: none;
    border-color: #1a5e3a;
    box-shadow: 0 0 0 3px rgba(26, 94, 58, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 400;
    font-size: 0.85rem;
    color: #555;
}

/* Completed khatm badge */
.khatm-badge {
    display: inline-block;
    background: #f0ece7;
    color: #b08d57;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Responsive */
@media (min-width: 640px) {
    .container {
        padding: 1.5rem;
    }

    .counter-main {
        font-size: 3rem;
    }

    .btn-record {
        font-size: 1.15rem;
        padding: 1.1rem 2.5rem;
    }
}

/* مودال */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f0ece7;
    color: #333;
}

/* دکمه بنر */
.banner-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #f0ece7;
    color: #b08d57;
    border: 1px solid #e0d8cc;
    border-radius: 20px;
    font-family: 'IRANYekan', Tahoma, sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.banner-btn:hover {
    background: #e8e0d5;
}

/* Group banner */
.group-banner {
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(176, 141, 87, 0.1);
    border: 1px solid rgba(176, 141, 87, 0.15);
    border-radius: 10px;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #b08d57;
    font-weight: 400;
}

/* Copy link banner */
.copy-link-banner {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(26, 94, 58, 0.1);
    border: 1px solid #c8e6c9;
}

/* Plyr overrides for RTL */
.plyr {
    direction: ltr;
    border-radius: 12px;
    --plyr-color-main: #1a5e3a;
}

.plyr--audio .plyr__controls {
    background: #f8f6f3;
    border-radius: 12px;
}

/* Fix tooltip clipping */
.collapse-content-inner {
    overflow: visible;
}

.plyr__tooltip,
.plyr__menu {
    z-index: 10;
}
