/* --- PeydaWeb Font Faces from static --- */
@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'PeydaWeb';
    src: url('/static/fonts/woff2/PeydaWeb-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
}


/* --- CSS Variables for easy theme management --- */
:root {
    --brand-primary: #B1BCC9;
    --brand-secondary: #5F6666;
    --toast-success: #28a745;
    --toast-warning: #ffc107;
    --toast-error: #dc3545;
    --toast-info: #3B82F6;
}

/* Applying the Persian font and a subtle background pattern */
body {
    font-family: 'PeydaWeb', sans-serif;
    background-color: #f0f2f5;
    background-image: radial-gradient(circle at 100% 0, rgba(177, 188, 201, 0.15) 0%, rgba(177, 188, 201, 0) 25%),
    radial-gradient(circle at 0 100%, rgba(95, 102, 102, 0.1) 0%, rgba(95, 102, 102, 0) 25%);
}

/* Custom styles for brand colors and buttons */
.bg-brand-primary {
    background-color: var(--brand-primary);
}

.bg-brand-secondary {
    background-color: var(--brand-secondary);
}

.text-brand-secondary {
    color: var(--brand-secondary);
}

.border-brand-primary {
    border-color: var(--brand-primary);
}

.ring-brand-primary {
    --tw-ring-color: var(--brand-primary);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);
}

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

.btn-primary {
    background-color: var(--brand-secondary);
    color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
    background-color: #4a5050;
}

.btn-secondary {
    background-color: var(--brand-primary);
    color: #000000;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #9aa4b1;
}

.btn-icon {
    background-color: transparent;
    color: #5F6666;
    box-shadow: none;
}

.btn-icon:hover {
    transform: translateY(-3px) scale(1.1);
    color: #000;
    background-color: rgba(177, 188, 201, 0.3);
}

/* Styles for the modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* --- Styles for the new OTP input display --- */
#otp-input-container {
    cursor: text;
}

#otp-display {
    direction: ltr;
}

.otp-digit {
    width: 40px;
    height: 50px;
    border-bottom: 3px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-secondary);
    transition: border-color 0.3s ease;
    position: relative; /* Needed for the pseudo-element cursor */
}

/* Style for the active digit's cursor */
.otp-digit.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 60%;
    background-color: var(--brand-secondary);
    animation: blink 1s infinite;
}

#otp-input:focus ~ #otp-display .otp-digit {
    border-color: var(--brand-primary);
}

#otp-input:focus ~ #otp-display .otp-digit.has-value {
    border-color: var(--brand-secondary);
}

/* --- Glassmorphism Toast Notification Styles --- */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: grid;
    gap: 1rem;
}

.toast {
    display: flex;
    align-items: center;
    width: 350px;
    max-width: 90vw;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideIn 0.5s ease forwards;
}

.toast.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.toast-content {
    margin-right: 0.75rem;
}

.toast-title {
    font-weight: 700;
}

.toast-message {
    font-size: 0.875rem;
    color: #333;
}

.toast-close-btn {
    margin-right: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
}

.toast-success {
    border-right: 5px solid var(--toast-success);
}

.toast-success .toast-icon {
    color: var(--toast-success);
}

.toast-info {
    border-right: 5px solid var(--toast-info);
}

.toast-info .toast-icon {
    color: var(--toast-info);
}

.toast-warning {
    border-right: 5px solid var(--toast-warning);
}

.toast-warning .toast-icon {
    color: var(--toast-warning);
}

.toast-error {
    border-right: 5px solid var(--toast-error);
}

.toast-error .toast-icon {
    color: var(--toast-error);
}

.input-error {
    border-color: var(--toast-error) !important;
    --tw-ring-color: var(--toast-error) !important;
}

.product-thumbnail {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.break-words-custom {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

body.modal-open {
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Blinking animation for the cursor */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}