body {
    overflow: auto;
    background-color: rgba(248, 247, 247, 1);
    position: relative;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(248, 247, 247, 1) 0%, rgba(255, 255, 255, 1) 50%, rgba(248, 247, 247, 1) 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
    animation: sidebarSlideIn 0.5s ease;
}

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

.sidebar .logo {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease 0.2s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar .logo img {
    max-width: 152px;
    height: auto;
    transition: transform 0.3s ease;
}

.sidebar .logo:hover img {
    transform: scale(1.05);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
    opacity: 0;
    animation: slideInRight 0.5s ease forwards;
}

.sidebar ul li:nth-child(1) { animation-delay: 0.1s; }
.sidebar ul li:nth-child(2) { animation-delay: 0.15s; }
.sidebar ul li:nth-child(3) { animation-delay: 0.2s; }
.sidebar ul li:nth-child(4) { animation-delay: 0.25s; }
.sidebar ul li:nth-child(5) { animation-delay: 0.3s; }
.sidebar ul li:nth-child(6) { animation-delay: 0.35s; }
.sidebar ul li:nth-child(7) { animation-delay: 0.4s; }
.sidebar ul li:nth-child(8) { animation-delay: 0.45s; }
.sidebar ul li:nth-child(9) { animation-delay: 0.5s; }
.sidebar ul li:nth-child(10) { animation-delay: 0.55s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar ul li a {
    color: rgba(39, 58, 65, 1);
    text-decoration: none;
    font-size: 16px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.sidebar ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #b7924f 0%, #d4af37 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 4px 4px 0;
}

.sidebar ul li.active a::before,
.sidebar ul li:hover a::before {
    transform: scaleY(1);
}

.sidebar ul li.active a {
    color: #b7924f !important;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(183, 146, 79, 0.1) 0%, rgba(183, 146, 79, 0.05) 100%);
    box-shadow: 0 2px 8px rgba(183, 146, 79, 0.15);
}

.sidebar ul li a:hover {
    color: #b7924f;
    background: linear-gradient(90deg, rgba(183, 146, 79, 0.08) 0%, rgba(183, 146, 79, 0.03) 100%);
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(183, 146, 79, 0.1);
}

.sidebar .nav-link.active {
    color: #b7924f;
}

.sidebar .icon {
    width: 22px;
    height: 22px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

.sidebar ul li.active .icon,
.sidebar ul li:hover .icon {
    filter: brightness(0) saturate(100%) invert(64%) sepia(29%) saturate(343%) hue-rotate(8deg) brightness(95%) contrast(90%);
    transform: scale(1.15) rotate(5deg);
}

.sidebar .nav-item {
    transition: all 0.3s ease;
    position: relative;
}

.sidebar .nav-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 60%;
    background: linear-gradient(90deg, transparent, rgba(183, 146, 79, 0.1));
    border-radius: 12px 0 0 12px;
    transition: width 0.3s ease;
}

.sidebar .nav-item:hover::after {
    width: 100%;
}

.sidebar .nav-item.active {
    background: linear-gradient(90deg, rgba(249, 248, 244, 1) 0%, transparent 100%);
    border-radius: 12px;
    position: relative;
}

.sidebar .nav-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #b7924f 0%, #d4af37 100%);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(183, 146, 79, 0.5);
}

/* Close Button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 2%;
    left: 0;
    font-size: 2rem;
    color: black;
    transition: all 0.3s ease;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(183, 146, 79, 0.1);
    color: #b7924f;
}

/* custom container */

.custom-container {
    padding: 0 20rem 0 0;
}

/* navbar */
.search-bar {
    padding-right: 1rem;
    width: 100%;
}

.search-bar input {
    background-color: rgba(39, 58, 65, 0.05);
    border: none;
    padding: .7rem;
}

.search-bar input::placeholder {
    color: rgba(156, 156, 156, 1);
    font-size: 14px;
    padding: .5rem;
}

.search-bar input {
    background-color: #f7f7f7;
    border: none;
    padding-right: 2.5rem;
}

.search-bar input:focus {
    box-shadow: none;
    background-color: #f7f7f7;
}

.search-bar i {
    color: rgba(158, 158, 158, 1);
    font-size: 16px;
}

/* Content */
.content {
    margin-right: 270px;
    padding: 1rem 3rem;
    transition: margin-left 0.3s ease-in-out;
}

.tree-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2rem 0 1rem;
    text-align: right;
    padding-right: 1rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInRight 0.8s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tree-card {
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: white;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
}

.tree-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(211, 171, 85, 0.05) 0%, rgba(211, 171, 85, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.tree-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 30px rgba(211, 171, 85, 0.2);
}

.tree-card:hover::before {
    opacity: 1;
}

.tree-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background-color: rgba(39, 58, 65, 0.1);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
}

.tree-card:hover img {
    transform: scale(1.1);
}

.card-footer {
    background-color: white;
    text-align: right;
    font-weight: 500;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.tree-card:hover .card-footer {
    background-color: rgba(249, 248, 244, 1);
}

/* Stagger animation for cards */
.tree-card:nth-child(1) { animation-delay: 0.1s; }
.tree-card:nth-child(2) { animation-delay: 0.2s; }
.tree-card:nth-child(3) { animation-delay: 0.3s; }
.tree-card:nth-child(4) { animation-delay: 0.4s; }
.tree-card:nth-child(5) { animation-delay: 0.5s; }
.tree-card:nth-child(6) { animation-delay: 0.6s; }
.tree-card:nth-child(7) { animation-delay: 0.7s; }
.tree-card:nth-child(8) { animation-delay: 0.8s; }
.tree-card:nth-child(9) { animation-delay: 0.9s; }
.tree-card:nth-child(10) { animation-delay: 1s; }
.tree-card:nth-child(11) { animation-delay: 1.1s; }
.tree-card:nth-child(12) { animation-delay: 1.2s; }
.tree-card:nth-child(13) { animation-delay: 1.3s; }
.tree-card:nth-child(14) { animation-delay: 1.4s; }
.tree-card:nth-child(15) { animation-delay: 1.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b7924f, #d4af37);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #b7924f);
}

/* Logout button special styling */
.sidebar .nav-item:last-child {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar .nav-item:last-child a {
    color: #dc3545 !important;
}

.sidebar .nav-item:last-child:hover a {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: #dc3545 !important;
}

.sidebar .nav-item:last-child:hover .icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(1352%) hue-rotate(327deg) brightness(92%) contrast(89%);
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar.show {
        transform: translateX(0%);
        animation: sidebarSlideIn 0.4s ease;
    }

    .sidebar-close {
        display: flex !important;
    }

    .content {
        margin-right: 0 !important;
        padding: .5rem;
    }

    .custom-container {
        padding: 0;
    }

    .search-bar {
        width: 100%;
    }
}

/* تخصيص إشعارات Toastify */
.toast-success {
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2E7D32;
}

.toast-error {
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #C62828;
}

.toastify {
    border-radius: 4px;
    padding: 12px 20px;
}

.toastify-avatar {
    width: 24px;
    height: 24px;
    margin-left: 10px;
}

.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.loading-spinner.active {
    display: block;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.loading-overlay.active {
    display: block;
}

.loading-overlay {
    transition: opacity 0.3s ease;
    opacity: 0;
}

.loading-overlay.active {
    opacity: 1;
}

.tree-section {
    background-color: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

.tree-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(0);
}

.tree-cover {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 220px;
    object-fit: cover;
}

.edit-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.edit-overlay i {
    margin-left: 6px;
}

.logo-box {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.logo-box img {
    max-height: 80px;
    margin-bottom: 10px;
}

.logo-box button {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
}

.btn-custom {
    background-color: rgba(211, 171, 85, 1);
    color: rgba(248, 247, 247, 1);
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(211, 171, 85, 0.3);
}

.btn-custom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-custom:hover::before {
    width: 300px;
    height: 300px;
}

.btn-custom:hover {
    background-color: rgb(211, 160, 51);
    color: rgba(248, 247, 247, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 171, 85, 0.4);
}

.btn-custom:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(211, 171, 85, 0.3);
}


@media (max-width: 768px) {
    .tree-cover {
        height: 180px;
    }
}

.modal-body input::placeholder {
    color: rgba(123, 123, 123, 0.5);
    font-size: 16px;
    font-weight: 400;
    text-align: right;
}

.modal-body input[type="text"],
input[type="date"],
input[type="tel"],
select {
    padding: 1rem;
    border-radius: 10px;
}

.modal-body label {
    margin-bottom: 1rem;
}


.form-check-input:checked {
    background-color: rgb(211, 160, 51);
    border-color: rgb(211, 160, 51);
}

.btn-outline-custom:hover {
    background-color: rgba(211, 171, 85, 1);
    color: rgba(248, 247, 247, 1);
}

.btn-outline-custom {
    background-color: rgba(248, 247, 247, 1);
    color: rgba(211, 171, 85, 1);
    border: rgba(211, 171, 85, 1) 1px solid;
    padding: 15px 22px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-outline-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(211, 171, 85, 1);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline-custom:hover::before {
    left: 0;
}

.btn-outline-custom:hover {
    color: rgba(248, 247, 247, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 171, 85, 0.3);
}

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

.selected {
    background-color: rgba(211, 171, 85, 0.2);
    color: rgba(162, 124, 42, 1) !important;
    animation: selectedPulse 2s ease infinite;
    position: relative;
}

.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, rgba(211, 171, 85, 1), rgba(211, 160, 51, 1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlow 2s ease infinite;
}

@keyframes selectedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.preview-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.preview-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(211, 171, 85, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.preview-box:hover::before {
    animation: shimmer 1.5s infinite;
    opacity: 1;
}

.preview-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: #fff;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.preview-img {
    width: 100%;
    max-height: 200px;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 10px;
    transition: transform 0.5s ease;
}

.preview-box:hover .preview-img {
    transform: scale(1.05);
}

.logo-img {
    width: 100%;
    max-height: 200px;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 10px;
    transition: transform 0.5s ease;
}

.preview-box:hover .logo-img {
    transform: scale(1.05) rotate(5deg);
}

/* قاعدة node */
.node {
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* قالب Classic */
.node.classic {
    background: #ffffff;
    border: 2px solid #caa13c;
    color: #333;
}

/* قالب Modern */
.node.modern {
    background: linear-gradient(135deg, #fff, #f0f6ff);
    border: none;
    color: #0b3d91;
}

/* قالب Compact */
.node.compact {
    background: #f7f7f7;
    border: 1px dashed #bbb;
    padding: 8px;
    font-size: 0.9rem;
}

/* صورة داخل العقدة */
.node .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 6px;
}

/* اسم */
.node .title {
    font-weight: 700;
}

/* صلة القرابة */
.node .subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

/* ===============================
   رسائل التنبيه المحسنة - Start Page
   =============================== */

.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 350px;
    max-width: 500px;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'AdorHairlineExtraBold', Arial, sans-serif;
    animation: slideInRight 0.4s ease-out;
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease;
}

.custom-alert.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(139, 195, 74, 0.95) 100%);
    color: white;
    border-left: 5px solid #4CAF50;
}

.custom-alert.error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(233, 30, 99, 0.95) 100%);
    color: white;
    border-left: 5px solid #f44336;
}

.custom-alert.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%);
    color: white;
    border-left: 5px solid #FF9800;
}

.custom-alert.info {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.95) 0%, rgba(3, 169, 244, 0.95) 100%);
    color: white;
    border-left: 5px solid #2196F3;
}

.alert-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.alert-icon {
    font-size: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.alert-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.alert-message {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    opacity: 0.95;
}

.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    animation: progressBar 4s linear;
}

/* الأنيميشن */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.custom-alert.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* أنيميشن pulse لزر "ابدأ الآن" */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
  }
}

/* تحسين مظهر الأزرار */
.btn-success-state {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  border: none !important;
  color: white !important;
  transition: all 0.3s ease !important;
}

.btn-loading {
  background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%) !important;
  border: none !important;
  color: white !important;
  cursor: not-allowed !important;
}

/* تجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .custom-alert {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        top: 10px;
    }
    
    .alert-title {
        font-size: 16px;
    }
    
    .alert-message {
        font-size: 14px;
    }
}

/* ===============================
   تأثيرات التحميل للأزرار
   =============================== */

.btn-custom:disabled,
.btn-outline-custom:disabled {
    cursor: not-allowed;
    opacity: 0.7 !important;
    pointer-events: none;
}

.btn-custom .fa-spinner,
.btn-outline-custom .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تأثير النجاح للأزرار */
.btn-success-state {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-success-state:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

/* تأثير التحميل */
.btn-loading {
    position: relative;
    overflow: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Additional Dynamic Animations */

/* Floating animation for crown icons */
.fa-crown {
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

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

/* Button animations */
.choose-template {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.choose-template::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(211, 171, 85, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.choose-template:hover::after {
    width: 300px;
    height: 300px;
}

.choose-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(211, 171, 85, 0.3);
}

/* Form input animations */
.form-control {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-control:focus {
    border-color: rgba(211, 171, 85, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(211, 171, 85, 0.25);
    transform: translateY(-2px);
}

/* Modal animations */
.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Section title animations */
.fw-bold.my-4 {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInRight 0.8s ease forwards;
}

.fw-bold.my-4:nth-of-type(1) { animation-delay: 0.2s; }
.fw-bold.my-4:nth-of-type(2) { animation-delay: 0.4s; }

/* Sidebar animations */
.sidebar {
    animation: sidebarSlideIn 0.5s ease;
}

@keyframes sidebarSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Loading spinner enhancement */
.loading-spinner {
    animation: spin 1s linear infinite, pulse 2s ease infinite;
}

/* Image preview animations */
#coverPreview,
#logoPreview {
    transition: all 0.3s ease;
    cursor: pointer;
}

#coverPreview:hover,
#logoPreview:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Card button hover effects */
.card-footer .btn {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.card-footer .btn:hover {
    transform: translateY(-2px);
}

/* Ripple effect for buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Sidebar ripple effect */
.sidebar-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(183, 146, 79, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive animations */
@media (max-width: 768px) {
    .tree-card {
        animation-duration: 0.4s;
    }
    
    .tree-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .btn-custom,
    .btn-outline-custom {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .sidebar ul li {
        animation-duration: 0.3s;
    }
}