﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    touch-action: manipulation;
    overscroll-behavior: none;
}
#profileBtn {
    display:flex;
    justify-content:center;
}
body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    -webkit-overflow-scrolling: touch;
}
.ltr {
    direction: ltr;
}
/* کانتینر اصلی - دقیقاً سایز عکس */
.card-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #2c2c2c;
    overflow:auto;
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    max-width:100%;
    max-height:100%;
}

.action-row {
    display: flex;
    flex-direction: row-reverse;
    margin-bottom: 1.6rem;
    touch-action: manipulation;
    justify-content:center
}

    /* حذف margin-bottom برای آخرین آیتم */
    .action-row:last-child {
        margin-bottom: 0;
    }


.action-buttons{
    padding:0.5rem;
}
/* دکمه‌های اکشن */
.action-button {
    margin-left: 0.5rem;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 24px;
    color: white;
    padding: 0;
    z-index: 100;
    background: rgb(217, 217, 217);
    color: #000;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-height: 44px;
    min-width: 44px;
    letter-spacing: 10%;
}
    .action-button:last-child {
        margin-left: 0;
    }
/* Phone Button */
.btn-phone {
    width: 100% !important;
    font-size: 16px;
    padding: 0 10px;
    justify-content: flex-start;
    gap: 10px;
}

/* Profile Button - پایین‌ترین دکمه */
.btn-profile {
    width: 100% !important;
    font-size: 16px;
    padding: 0 10px;
    justify-content: flex-start;
    gap: 10px;
}

/* برای دکمه‌های غیرفعال */
.action-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* استایل‌های hover و active */
.action-button:hover,
.action-button:active {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

/* حالت active برای موبایل */
.action-button:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

/* مدال اشتراک‌گذاری */
.share-modal, .code-modal, .info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    touch-action: none;
}
.code-modal img{
    width:100%;
    height:auto;
}
    .share-modal.active, .code-modal.active, .info-modal.active {
        display: flex;
        animation: modalFadeIn 0.3s ease;
    }

.share-modal-content, .code-modal-content, .info-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    touch-action: manipulation;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    flex-wrap: wrap;
    touch-action: manipulation;
}

.share-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
    user-select: none;
    min-height: 60px;
    min-width: 60px;
}

    .share-option:hover,
    .share-option:active {
        transform: scale(1.1);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    }

    .share-option:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }

/* لودینگ */
.loading-overlay {
    display:none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    touch-action: none;
}

    .loading-overlay.active {
        display: flex;
        animation: fadeIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.action-area {
    touch-action: manipulation;
    pointer-events: auto;
    width: 100%;
    padding: 0 2rem;
}

.action-buttons {
    display: inline-block;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    touch-action: manipulation;
    justify-content: space-between;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    html, body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .card-container {
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .card-image {
        width: 100%;
        height: auto;
        aspect-ratio: 5/6;
    }

    .action-button {
        width: 49px;
        height: 49px;
        font-size: 20px;
        min-height: 47px;
        min-width: 47px;
        letter-spacing: 8%;
    }
    .btn-profile {
        letter-spacing: 2%;
    }
    /* بهبود کلیک در موبایل */
    .action-button::after {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        z-index: -1;
    }
    .action-row {
        margin-bottom: 1.2rem;
    }
    .action-area {
        padding: 0 1rem !important;
    }
}
@media (max-width: 510px) {
    .action-button {
        width: 45px;
        height: 45px;
        font-size: 18px;
        min-height: 44px;
        min-width: 44px;
        letter-spacing: 5%;
    }
    .action-row {
        margin-bottom: 1rem;
    }
    .action-area {
        padding: 0 .5rem !important;
    }
}
@media (max-width: 480px) {
    .action-button {
        width: 42px;
        height: 42px;
        font-size: 17px;
        min-height: 43px;
        min-width: 43px;
        letter-spacing: 5%;
    }
    .btn-profile {
        letter-spacing: 0;
    }
    .action-row {
        margin-bottom: .8rem;
    }
    .action-area {
        padding: 0 .3rem !important;
    }
}
@media (max-width: 430px) {
    .action-button {
        width: 38px;
        height: 38px;
        font-size: 15px;
        min-height: 40px;
        min-width: 40px;
        letter-spacing:0;
    }
    .share-modal-content, .code-modal-content {
        padding: 20px;
        margin: 20px;
    }

    .share-option {
        width: 50px;
        height: 50px;
        font-size: 20px;
        min-height: 50px;
        min-width: 50px;
    }
    .action-row {
        margin-bottom: .5rem;
    }
}
@media (max-width: 360px) {
    .action-button {
        width: 30px;
        height: 30px;
        font-size: 12px;
        min-height: 34px;
        min-width: 34px;
        letter-spacing: 0;
    }
    .btn-profile {
        letter-spacing: -5%;
    }
    .action-row {
        margin-bottom: .4rem;
    }

}
@media (max-width: 280px) {
    .action-button {
        width: 22px;
        height: 22px;
        font-size: 9px;
        min-height: 24px;
        min-width: 24px;
        letter-spacing: 0;
    }
    .action-row {
        margin-bottom: .3rem;
    }
}
/* برای لنداسکیپ */
@media (orientation: landscape) and (max-height: 600px) {
    .card-container {
        height: auto;
        max-height: 100vh;
    }

    .card-image {
        height: 100vh;
        width: auto;
        max-width: 100%;
    }

    .action-area {
    }
}

/* بهبود برای iOS Safari */
@supports (-webkit-touch-callout: none) {
    .card-container {
        height: -webkit-fill-available;
    }

    .card-image {
        height: -webkit-fill-available;
    }

    .action-button {
        cursor: default;
    }
    /* جلوگیری از zoom دابل تپ در iOS */
    body {
        touch-action: pan-x pan-y;
    }
}

/* بهبود برای دستگاه‌های لمسی */
@media (hover: none) and (pointer: coarse) {
    .action-button:hover {
        transform: none;
    }

    .action-button:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* جلوگیری از انتخاب متن در موبایل */
.no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
/* استایل اضطراری برای موبایل */
.mobile-touch-fix {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.no-user-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* بهبود دکمه‌ها برای همه دستگاه‌ها */
button {
    cursor: pointer;
}

    button:disabled {
        cursor: not-allowed;
    }

/* استایل‌های اضافه برای جلوگیری از تداخل */
.safe-click-area {
    position: relative;
    z-index: 1000;
    text-decoration:none;
}

.action-button.prevent-multiple-click {
    pointer-events: auto !important;
}

/* برای موبایل - جلوگیری از zoom دابل تپ */
@media (hover: none) and (pointer: coarse) {
    body {
        touch-action: pan-x pan-y;
    }

    button {
        touch-action: manipulation;
    }
}
/* استایل برای نمایش اطلاعات مرورگر */
.browser-info-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 51, 102, 0.95);
    color: white;
    padding: 8px 15px;
    font-size: 12px;
    z-index: 10000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.browser-info-item {
    margin: 2px 5px;
    display: flex;
    align-items: center;
}

.browser-info-icon {
    margin-right: 5px;
    font-size: 14px;
}

.browser-info-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.3s;
}

    .browser-info-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
    }

/* بهبود استایل برای iOS */
.ios-safe-area {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* رفع مشکل کلیک در iOS */
.ios-click-fix {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* بهبود نمایش در Safari iOS */
@supports (-webkit-touch-callout: none) {
    .card-container {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    .action-button {
        -webkit-appearance: none;
        appearance: none;
    }
}

/* رفع مشکل rubber-band scrolling در iOS */
body {
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

/* بهبود لودینگ برای iOS */
.loading-overlay {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* رفع مشکل viewport در iOS */
@media screen and (max-width: 768px) {
    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
}

/* استایل برای پیام‌های iOS */
.ios-message {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #003366;
    color: white;
    padding: 15px;
    border-radius: 10px;
    z-index: 10001;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 14px;
}
.btn-phone, .btn-profile {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: keep-all !important;
    padding: 0 8px !important; /* کاهش padding برای فضای بیشتر */
}
i.ti{
    font-size: 1.6rem;
}
.form-group .input-group-addon, .input-group .input-group-addon {
    padding: 10px;
}
@media (max-width: 768px) {
    .info-modal.active {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .info-modal-content {
        position: relative;
        margin: 20px;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* بهبود نمایش keyboard در اندروید */
    .info-modal input,
    .info-modal textarea,
    .info-modal select {
        font-size: 16px; /* جلوگیری از zoom خودکار */
        min-height: 44px; /* اندازه مناسب برای لمس */
        padding: 10px;
        border-radius: 8px;
        border: 1px solid #ddd;
        background: white;
        color: #333;
        width: 100%;
        box-sizing: border-box;
    }

        .info-modal input:focus,
        .info-modal textarea:focus,
        .info-modal select:focus {
            outline: none;
            border-color: #003366;
            box-shadow: 0 0 0 2px rgba(0,51,102,0.2);
        }
    /* جلوگیری از zoom خودکار در اندروید */
    .info-modal input,
    .info-modal textarea,
    .info-modal select {
        -webkit-text-size-adjust: 100%;
    }
}
#browserInfoContainer {
    display: none !important;
    visibility: hidden !important;
}