/* Buttons */
.btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(.2,.9,.2,1), box-shadow 0.25s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    will-change: transform;
    /* ensure all buttons render Arabic text correctly and are visually coordinated */
    direction: rtl;
    text-align: right;
    font-family: 'Noto Sans Arabic', sans-serif;
}

.btn::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -30%;
    width: 160%;
    height: 90%;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
    transform: rotate(-18deg);
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(120deg, rgba(255,255,255,0.06) 0% 10%, rgba(255,255,255,0.02) 10% 20%, rgba(255,255,255,0) 20% 100%);
    background-size: 60px 60px;
    opacity: 0.6;
    transform: translateZ(0);
    transition: opacity 0.25s, transform 0.35s;
    z-index: 0;
    mix-blend-mode: overlay;
}

.btn:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 40px rgba(45,122,62,0.14);
}

.btn:hover::after {
    animation: ribbonMove 1.2s linear infinite;
    opacity: 0.85;
    transform: translateY(-4px);
}

@keyframes ribbonMove {
    from { background-position: 0 0; }
    to { background-position: 60px 0; }
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(45, 122, 62, 0.18);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    box-shadow: 0 18px 44px rgba(45,122,62,0.22);
}

/* Custom style for the navbar's primary button */
.nav-actions .btn-primary {
    background: var(--gray-900);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.nav-actions .btn-primary:hover {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.btn-secondary {
    background: linear-gradient(90deg, var(--white) 0%, #f7f9f7 100%);
    color: var(--primary-green);
    border: 2px solid rgba(45,122,62,0.12);
    box-shadow: inset 0 -4px 12px rgba(0,0,0,0.03);
}

.btn-secondary:hover {
    box-shadow: inset 0 -6px 16px rgba(0,0,0,0.06), 0 10px 28px rgba(45,122,62,0.10);
}

.btn-outline {
    background: transparent;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    box-shadow: none;
}

.btn-outline::after {
    background-image: linear-gradient(120deg, rgba(45,122,62,0.03) 0% 12%, rgba(45,122,62,0.015) 12% 22%, rgba(255,255,255,0) 22% 100%);
    opacity: 0.5;
}

.btn-outline:hover {
    box-shadow: 0 12px 32px rgba(45,122,62,0.12);
    background: linear-gradient(90deg, rgba(45,122,62,0.08), rgba(45,122,62,0.03));
    color: var(--white);
    border-color: rgba(255,255,255,0.12);
}

.btn-large {
    padding: 12px 22px;
    font-size: 15px;
}

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

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Add full width button utility */
.btn-full-width {
    width: 100%;
    justify-content: center;
}

/* Ensure icons/text sit above decorative layers */
.btn > * { position: relative; z-index: 2; }
.btn-icon {
    position: relative;
    z-index: 2;
}

/* Add: focus-visible and active states */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45,122,62,0.18);
}

.btn:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 10px 28px rgba(45,122,62,0.16);
}

/* Responsive tweak for touch: reduce hover lift on small screens */
@media (max-width: 768px) {
    .btn:hover { transform: none; box-shadow: 0 6px 18px rgba(45,122,62,0.12); }
    .btn::after { animation: none; }
}