/* ========================================
   استایل عمارت باغ زندگی
   طراحی مدرن و مینیمال
   ======================================== */

:root {
    --primary-color: #71ffd9;
    --primary-dark: #3dd9b3;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --background: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: linear-gradient(135deg, #f0fdfb 0%, #e6fcf8 50%, #f5fffe 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    position: relative;
}

/* پترن زیبای عروسی برای پس‌زمینه */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(
            circle at 20% 50%,
            rgba(113, 255, 217, 0.15) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(255, 215, 0, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 40% 80%,
            rgba(113, 255, 217, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 60% 20%,
            rgba(255, 239, 213, 0.12) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: 0;
}

/* اطمینان از اینکه محتوا بالای پترن باشه */
body > * {
    position: relative;
    z-index: 1;
}

/* پس‌زمینه عروسی برای صفحات با navbar */
body:has(.navbar) {
    background: linear-gradient(135deg, #f0fdfb 0%, #e6fcf8 100%);
}

/* برای مرورگرهایی که :has را ساپورت نمی‌کنند */
.navbar ~ #page-container {
    background: transparent;
}

/* صفحه لاگین */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* المان‌های تزئینی عروسی */
.login-wrapper::before,
.login-wrapper::after {
    content: "💐";
    position: absolute;
    font-size: 80px;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.login-wrapper::before {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.login-wrapper::after {
    content: "💕";
    bottom: 10%;
    left: 10%;
    animation-delay: 3s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(113, 255, 217, 0.2),
        0 0 0 1px rgba(113, 255, 217, 0.1);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

/* هدر لاگین */
.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(
        135deg,
        rgba(113, 255, 217, 0.15) 0%,
        rgba(113, 255, 217, 0.25) 100%
    );
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(113, 255, 217, 0.3),
        0 0 40px rgba(113, 255, 217, 0.2);
    position: relative;
    padding: 0px;
    border: 3px solid rgba(113, 255, 217, 0.4);
}

.logo-circle::before {
    content: "";
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #ffd700, #71ffd9, #71ffd9);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.25;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.25;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.4;
    }
}

.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.logo-circle i {
    font-size: 36px;
    color: var(--white);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin: 0;
}

/* فرم‌ها */
.login-forms {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input[type="number"] {
    direction: ltr;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: #71ffd9;
    box-shadow: 0 0 0 4px rgba(113, 255, 217, 0.1);
}

.form-control::placeholder {
    color: #adb5bd;
}

.form-control[readonly] {
    background: #f8f9fa;
    cursor: not-allowed;
}

/* دکمه‌ها */
.btn {
    height: 50px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #71ffd9;
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(113, 255, 217, 0.3);
    font-weight: 600;
}

.btn-primary:hover {
    background: #3dd9b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(113, 255, 217, 0.4);
    color: var(--text-dark);
}

.btn-primary:active {
    transform: translateY(0);
}

/* استایل loader دکمه‌ها */
.btn.position-relative {
    position: relative;
}

.btn-loader {
    background-color: #3dd9b3;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-loader i {
    color: var(--white);
    font-size: 20px;
}

.btn-primary .btn-loader {
    background-color: #3dd9b3;
    box-shadow: 0 4px 15px rgba(113, 255, 217, 0.3);
}

.btn-primary .btn-loader i {
    color: var(--white);
    animation: fa-spin 1s infinite linear;
}

.btn-secondary .btn-loader {
    background-color: #5a6268;
}

.btn-secondary .btn-loader i {
    color: var(--white);
    animation: fa-spin 1s infinite linear;
}

.btn-block {
    width: 100%;
    display: block;
}

/* آلرت‌ها */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    border: none;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #e8f4f8 100%);
    color: #1976d2;
    border-left: 4px solid #42a5f5;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    color: #2e7d32;
    border-left: 4px solid #66bb6a;
}

.alert-link {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid;
    margin-right: 8px;
}

.alert-link:hover {
    opacity: 0.8;
}

/* فوتر لاگین */
.login-footer {
    text-align: center;
}

.login-footer p {
    color: #2c7a65;
    font-size: 14px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* حالت لودینگ */
.block-mode-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.block-mode-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #71ffd9;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* استایل‌های عمومی برای پنل */
.block {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(113, 255, 217, 0.08);
    margin-bottom: 24px;
    border: 1px solid rgba(113, 255, 217, 0.05);
}

.block-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.block-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.block-content {
    padding: 24px;
}

/* جدول‌ها */
.table {
    width: 100%;
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    color: var(--text-dark);
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* بج‌ها */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .login-title {
        font-size: 24px;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }

    .logo-circle i {
        font-size: 30px;
    }

    /* المان تزئینی پایین صفحه */
    .login-wrapper::after {
        bottom: 5%;
        left: 5%;
        font-size: 60px;
        opacity: 0.1;
    }

    .login-wrapper::before {
        top: 5%;
        right: 5%;
        font-size: 60px;
        opacity: 0.1;
    }
}

/* حذف استایل‌های اضافی برای input type number */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* اسکرول بار */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #71ffd9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3dd9b3;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.justify-content-center {
    justify-content: center;
}

/* دکمه‌های Secondary */
.btn-secondary {
    background: #6c757d;
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* حالت disabled برای دکمه‌ها */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ایکون‌های داخل دکمه */
.btn i {
    vertical-align: middle;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-6,
.col-md-12,
.col-lg-8 {
    padding: 0 15px;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-6 {
        width: 50%;
    }

    .col-md-12 {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .col-lg-8 {
        width: 66.666667%;
    }
}

/* نوتیفیکیشن‌ها */
.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    color: #c62828;
    border-left: 4px solid #ef5350;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 100%);
    color: #e65100;
    border-left: 4px solid #ffa726;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.login-card,
.block {
    animation: fadeIn 0.4s ease-out;
}

#new-user-fields {
    animation: slideDown 0.5s ease-out;
    overflow: hidden;
}

#new-user-fields .alert {
    margin-bottom: 1rem;
    border-right: 4px solid #71ffd9;
}

/* Loading state for buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Focus visible برای accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #71ffd9;
    outline-offset: 2px;
}

/* Navbar */
.navbar {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 253, 251, 0.95) 100%
    );
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(113, 255, 217, 0.12);
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(113, 255, 217, 0.1);
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: #3dd9b3 !important;
}

.navbar-toggler {
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-left: 1rem;
}

.navbar-toggler:focus {
    outline: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0 0.5rem;
}

.nav-link {
    color: var(--text-dark) !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(113, 255, 217, 0.1);
    color: #3dd9b3 !important;
}

.navbar-text {
    color: var(--text-light);
    font-size: 14px;
}

.text-primary {
    color: #71ffd9 !important;
}

.text-danger {
    color: #dc3545 !important;
}

@media (max-width: 991px) {
    .navbar-collapse {
        margin-top: 1rem;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-item {
        margin: 0.25rem 0;
        width: 100%;
    }

    .nav-link {
        width: 100%;
    }
}

/* Bootstrap Notify Styles */
[data-notify="container"] {
    border-radius: 12px;
    padding: 18px 24px;
    font-size: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    border: none;
    font-family: "Vazirmatn", sans-serif;
    position: relative;
    min-width: 320px;
    max-width: 450px;
}

[data-notify="container"].alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e9 100%);
    color: #155724;
    border-left: 4px solid #66bb6a;
}

[data-notify="container"].alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #ffebee 100%);
    color: #721c24;
    border-left: 4px solid #ef5350;
}

[data-notify="container"].alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
    color: #856404;
    border-left: 4px solid #ffa726;
}

[data-notify="container"].alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #e3f2fd 100%);
    color: #0c5460;
    border-left: 4px solid #42a5f5;
}

[data-notify="message"] {
    font-weight: 500;
    line-height: 1.5;
    display: block;
}

/* Responsive notification */
@media (max-width: 480px) {
    [data-notify="container"] {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        font-size: 14px;
        padding: 16px 20px;
    }
}

/* Print styles */
@media print {
    .login-wrapper {
        background: white;
    }

    .btn,
    .login-footer {
        display: none;
    }

    [data-notify="container"] {
        display: none !important;
    }
}
