﻿
.camera-card {
    background: #fff;
  /*  border: 1px solid #e9ecef;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(20,30,50,.06);*/
    direction: rtl;
    overflow: hidden
}

.camera-stage {
    max-width: 1400px;
    margin: auto;
}

.camera-stage-title {
    text-align: center;
    margin-bottom: 28px
}

    .camera-stage-title h3 {
        margin: 0 0 7px;
        font-size: 25px;
        font-weight: 800;
        color: #202938
    }

    .camera-stage-title p {
        margin: 0;
        color: #7a8494;
        font-size: 13px
    }

.camera-layout {
    align-items: center;
    gap: 28px
}

.camera-center {
    min-width: 0
}

.camera-box {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3.5;
    padding: 12px;
 /*   border: 1px solid #e5e9ef;
    border-radius: 22px;
    background: #f7f9fb;
    box-shadow: 0 12px 35px rgba(20,30,50,.07)*/
}


/* =========================
   Slider
========================= */

.camera-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4/3.5;
    border-radius: 15px;
/*    background: #e9edf2*/
}

.camera-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s ease,visibility .7s ease
}

    .camera-slide.active {
        opacity: 1;
        visibility: visible
    }

    .camera-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain
    }

.camera-slide-overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 55px 25px 28px;
    color: #fff;
    display:none;
}

    .camera-slide-overlay strong {
        font-size: 18px;
        font-weight: 800
    }

    .camera-slide-overlay span {
        font-size: 12px;
        opacity: .9
    }

.camera-slider-dots {
    position: absolute;
    right: 50%;
    bottom: 13px;
    z-index: 3;
    display: flex;
    gap: 6px;
    transform: translateX(50%)
}

    .camera-slider-dots span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255,255,255,.55);
        transition: all .3s ease
    }

        .camera-slider-dots span.active {
            width: 20px;
            border-radius: 10px;
            background: #fff
        }


/* =========================
   Camera
========================= */

.camera-preview {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    background: #10151c;
/*    opacity: 0;
    visibility:hidden;*/
    display: none;
    transform: scale(.98);
    transition: opacity .5s ease,visibility .5s ease,transform .5s ease
}

    .camera-preview.active {
        display:block;
        transform: scale(1)
    }

#camera {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: 4/3.5;
    object-fit: cover;
    background: #10151c;
    transform: scaleX(-1);
    border-radius: inherit;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none
}

.face-guide {
    position: absolute;
    left: 50%;
    top: 47%;
    width: 205px;
    height: 275px;
    transform: translate(-50%,-50%);
    border: 2px dashed rgba(255,255,255,.9);
    border-radius: 48% 48% 45% 45%;
    box-shadow: 0 0 0 999px rgba(0,0,0,.08)
}

.camera-status {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 30px;
    background: rgba(20,25,35,.58);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: .9em
}

    .camera-status span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #39c76a;
        box-shadow: 0 0 0 4px rgba(57,199,106,.15);
        animation: cameraStatusPulse 1.8s infinite
    }

    .camera-status b {
        font-weight: 600
    }

@keyframes cameraStatusPulse {
    0%,100% {
        opacity: 1
    }

    50% {
        opacity: .45
    }
}

.camera-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #fff;
    border-style: solid
}

.camera-corner-top-right {
    top: 25px;
    right: 25px;
    border-width: 3px 3px 0 0;
    border-radius: 0 6px 0 0
}

.camera-corner-top-left {
    top: 25px;
    left: 25px;
    border-width: 3px 0 0 3px;
    border-radius: 6px 0 0 0
}

.camera-corner-bottom-right {
    bottom: 25px;
    right: 25px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 6px 0
}

.camera-corner-bottom-left {
    bottom: 25px;
    left: 25px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 6px
}


/* =========================
   Main Circular Button
========================= */

.camera-main-action {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5em;
}

.camera-circle-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .25s ease,opacity .3s ease,visibility .3s ease
}

    .camera-circle-btn:hover {
        transform: scale(1.06)
    }

    .camera-circle-btn:active {
        transform: scale(.94)
    }

.camera-circle-inner {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: inherit;
    height: inherit;
    border-radius: 50rem;
    background: #356ae6;
    color: #fff;
    box-shadow: 0 5px 15px rgba(53,106,230,.25)
}

    .camera-circle-inner svg {
        width: 40px;
        height: 40px
    }


/* دکمه باز کردن */

.camera-open-btn {
    background: transparent;
    color: #356ae6
}

    .camera-open-btn .camera-circle-ring {
        position: absolute;
        inset: 0;
        border: 2px solid rgba(53,106,230,.9);
        border-radius: 50%;
        animation: cameraRing 3s ease-out infinite
    }

        .camera-open-btn .camera-circle-ring:after {
            content: "";
            position: absolute;
            inset: -7px;
            border: 1px solid rgba(53,106,230,.12);
            border-radius: 50%
        }

@keyframes cameraRing {
    0% {
        transform: scale(.85);
        opacity: .95
    }

    30% {
        transform: scale(.85);
        opacity: .95
    }

    70% {
        transform: scale(1.35);
        opacity: 0
    }

    100% {
        transform: scale(1.35);
        opacity: 0
    }
}


/* دکمه گرفتن عکس */

.camera-capture-btn {
    background: transparent;
    color: #20a35a;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    transform: scale(.7)
}

    .camera-capture-btn.active {
        position: relative;
        opacity: 1;
        visibility: visible;
        transform: scale(1)
    }

    .camera-capture-btn .camera-circle-inner {
        background: #20a35a;
        box-shadow: 0 6px 18px rgba(32,163,90,.3)
    }

    .camera-capture-btn:hover .camera-circle-inner {
        background: #198b4c
    }

    .camera-capture-btn:disabled {
        opacity: .5;
        cursor: not-allowed
    }


/* =========================
   Guides
========================= */

.camera-guides {
    display: flex;
    flex-direction: column;
    gap: 22px
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 11px
}

.camera-guides-right .guide-item {
    text-align: left;
    flex-direction: row-reverse
}

.guide-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 14px
}

    .guide-icon svg {
        width: 21px;
        height: 21px
    }

.guide-icon-blue {
    background: #edf4ff;
    color: #356ae6
}

.guide-icon-orange {
    background: #fff7e8;
    color: #f0a21a
}

.guide-icon-green {
    background: #ebf9f0;
    color: #20a35a
}

.guide-icon-red {
    background: #fff0f0;
    color: #e04b4b
}

.guide-icon-purple {
    background: #f4edff;
    color: #8555d4
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px
}

    .guide-content strong {
        font-size: 13px;
        font-weight: 750;
        color: #2c3544
    }

    .guide-content span {
        font-size: .95em;
        line-height: 1.9;
        color: #8993a2
    }


/* =========================
   Alert
========================= */

.guide-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    max-width: 850px;
    margin: 25px auto 0;
    padding: 12px 18px;
    border: 1px solid #d9e6fa;
    border-radius: 12px;
    background: #f3f7fd;
    color: #4269a3;
    font-size: .9em;
    line-height: 1.8;
    text-align: center
}

    .guide-alert svg {
        width: 17px;
        height: 17px;
        flex: none
    }


/* =========================
   Preview
========================= */

.photo-result {
    display: none;
    margin: 25px auto 0;
    max-width: 800px;
    padding: 20px;
    border: 1px solid #dcebe2;
    border-radius: 18px;
    background: #f7fcf9
}

.photo-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px
}

    .photo-result-header h4 {
        margin: 0 0 5px;
        font-size: 16px;
        font-weight: 800;
        color: #315b42
    }

    .photo-result-header span {
        font-size: .9em;
        color: #82928a
    }

.photo-result-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 12px;
    background: #e6f5eb;
    color: #20a35a
}

    .photo-result-icon svg {
        width: 20px;
        height: 20px
    }

.photo-preview-box {
    display: flex;
    flex-direction:column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    padding: 15px;
    border: 1px dashed #c9ded0;
    border-radius: 14px;
    background: #fff
}

#previewImage {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    color:transparent
}

.camera-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    color: #929aa6;
    font-size: .9em
}

    .camera-security svg {
        width: 15px;
        height: 15px
    }


.loading-text {
    font-weight: bold;
    background: linear-gradient(90deg, #356ae6, #20a35a, #356ae6);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: loading 1s infinite linear;
}

@keyframes loading {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* =========================
  ai Loading
========================= */

.preview-loading {
    padding-top: 3em;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.spinner {
    width: 55px;
    height: 55px;
    border: 5px solid #e9ecef;
    border-top-color: #20a35a;
    border-radius: 50%;
    animation: previewSpin 0.8s linear infinite;
}

.loading-text {
    font-size: 15px;
    color: #666;
    text-align: center;
}

@keyframes previewSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   Responsive
========================= */

@media(max-width:1100px) {

    .camera-layout {
        gap: 18px
    }

    .guide-content span {
        font-size: .9em
    }

    .guide-content strong {
        font-size: 12px
    }

    .guide-icon {
        width: 40px;
        height: 40px
    }
}

@media(max-width:900px) {

    .camera-layout {
        gap: 15px
    }

    .camera-center {
        order: 1;
        max-width: 620px;
        width: 100%;
        margin: auto
    }

    .camera-guides-right {
        order: 2
    }

    .camera-guides-left {
        order: 3
    }

    .camera-guides {
        display: flex;
        gap: 15px;
        max-width: 620px;
        width: 100%;
        margin: auto
    }

    .camera-guides-left .guide-item {
        flex-direction: row
    }

}

@media(max-width:767px) {

    .camera-guides-right .guide-item {
        text-align: inherit;
        flex-direction: row
    }
}

@media(max-width:575px) {

    .camera-stage {
        padding: 10px
    }

    .camera-stage-title {
        margin-bottom: 18px
    }

        .camera-stage-title h3 {
            font-size: 20px
        }

        .camera-stage-title p {
            font-size: .9em;
            line-height: 1.8
        }

    .camera-box {
        padding: 8px;
        border-radius: 17px
    }

    .camera-slider,
    .camera-preview {
        border-radius: 11px
    }

    .camera-slide-overlay {
        padding: 40px 15px 20px
    }

        .camera-slide-overlay strong {
            font-size: 14px
        }

        .camera-slide-overlay span {
            font-size: 10px
        }

    .face-guide {
        width: 165px;
        height: 225px
    }

    .camera-guides {
        gap: 12px
    }

    .guide-item {
        padding: 5px 0
    }

    .guide-alert {
        margin-top: 18px;
    }
}
