/**
 * NEXUS Property OS - Arabic Geometric Patterns
 * Luxury Islamic Art Inspired Design System
 */

/* ============================================
   CSS VARIABLES FOR PATTERNS
   ============================================ */
:root {
    --pattern-gold: #D4AF37;
    --pattern-gold-light: rgba(212, 175, 55, 0.15);
    --pattern-gold-glow: rgba(212, 175, 55, 0.4);
    --pattern-teal: #00D4AA;
    --pattern-teal-light: rgba(0, 212, 170, 0.1);
    --pattern-navy: #0A1628;
    --pattern-navy-light: #1a2942;
}

/* ============================================
   ISLAMIC GEOMETRIC PATTERN OVERLAYS
   ============================================ */

/* Eight-Pointed Star Pattern (Rub el Hizb) */
.pattern-star-8 {
    position: relative;
}

.pattern-star-8::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.5'%3E%3Cpolygon points='40,5 50,30 75,30 55,45 65,70 40,55 15,70 25,45 5,30 30,30'/%3E%3Ccircle cx='40' cy='40' r='15'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* Arabesque Interlocking Pattern */
.pattern-arabesque {
    position: relative;
}

.pattern-arabesque::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.6'%3E%3Cpath d='M0,50 Q25,25 50,50 T100,50'/%3E%3Cpath d='M0,50 Q25,75 50,50 T100,50'/%3E%3Cpath d='M50,0 Q25,25 50,50 T50,100'/%3E%3Cpath d='M50,0 Q75,25 50,50 T50,100'/%3E%3Ccircle cx='50' cy='50' r='20'/%3E%3Ccircle cx='50' cy='50' r='10'/%3E%3Crect x='35' y='35' width='30' height='30' transform='rotate(45 50 50)'/%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* Hexagonal Zellige Pattern */
.pattern-zellige {
    position: relative;
}

.pattern-zellige::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' viewBox='0 0 60 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.5'%3E%3Cpolygon points='30,0 60,15 60,37 30,52 0,37 0,15'/%3E%3Cpolygon points='30,10 50,20 50,32 30,42 10,32 10,20'/%3E%3Ccircle cx='30' cy='26' r='6'/%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* Diamond Lattice Pattern */
.pattern-lattice {
    position: relative;
}

.pattern-lattice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.5'%3E%3Crect x='10' y='10' width='20' height='20' transform='rotate(45 20 20)'/%3E%3Crect x='15' y='15' width='10' height='10' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* Moroccan Quatrefoil Pattern */
.pattern-quatrefoil {
    position: relative;
}

.pattern-quatrefoil::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.6'%3E%3Ccircle cx='30' cy='15' r='12'/%3E%3Ccircle cx='30' cy='45' r='12'/%3E%3Ccircle cx='15' cy='30' r='12'/%3E%3Ccircle cx='45' cy='30' r='12'/%3E%3Ccircle cx='30' cy='30' r='8'/%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* ============================================
   ANIMATED PATTERN BORDERS
   ============================================ */

/* Animated Gold Border */
.border-gold-animated {
    position: relative;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.border-gold-animated::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--pattern-gold) 25%,
        var(--pattern-gold) 50%,
        var(--pattern-gold) 75%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmerBorder 3s ease-in-out infinite;
    z-index: -1;
    opacity: 0.5;
    border-radius: inherit;
}

@keyframes shimmerBorder {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pulsing Teal Border */
.border-teal-pulse {
    position: relative;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.border-teal-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--pattern-teal);
    border-radius: inherit;
    animation: pulseBorder 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseBorder {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* ============================================
   DECORATIVE CORNER ORNAMENTS
   ============================================ */

.corner-ornament {
    position: relative;
}

.corner-ornament::before,
.corner-ornament::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--pattern-gold);
    opacity: 0.5;
}

.corner-ornament::before {
    top: -5px;
    left: -5px;
    border-right: none;
    border-bottom: none;
}

.corner-ornament::after {
    bottom: -5px;
    right: -5px;
    border-left: none;
    border-top: none;
}

/* Luxury Corner Ornament with Pattern */
.corner-ornament-luxury {
    position: relative;
}

.corner-ornament-luxury::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: 40px;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 L40,0 L40,5 L5,5 L5,40 L0,40 Z' fill='%23D4AF37'/%3E%3Cpath d='M10,10 L10,25 M10,10 L25,10' stroke='%23D4AF37' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    opacity: 0.6;
}

.corner-ornament-luxury::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40,40 L0,40 L0,35 L35,35 L35,0 L40,0 Z' fill='%23D4AF37'/%3E%3Cpath d='M30,30 L30,15 M30,30 L15,30' stroke='%23D4AF37' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    opacity: 0.6;
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */

/* Ornate Divider */
.divider-ornate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
}

.divider-ornate::before,
.divider-ornate::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pattern-gold), transparent);
}

.divider-ornate .ornament {
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='1'%3E%3Crect x='5' y='5' width='20' height='20' transform='rotate(45 15 15)'/%3E%3Ccircle cx='15' cy='15' r='5'/%3E%3C/g%3E%3C/svg%3E");
}

/* Gold Line Divider */
.divider-gold {
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--pattern-gold-light) 20%,
        var(--pattern-gold) 50%,
        var(--pattern-gold-light) 80%,
        transparent);
    margin: 2rem 0;
}

/* Teal Gradient Divider */
.divider-teal {
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--pattern-teal-light) 20%,
        var(--pattern-teal) 50%,
        var(--pattern-teal-light) 80%,
        transparent);
    margin: 2rem 0;
}

/* ============================================
   CARD ENHANCEMENT PATTERNS
   ============================================ */

/* Luxury Card with Pattern Background */
.card-luxury {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 41, 66, 0.9), rgba(10, 22, 40, 0.95));
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    overflow: hidden;
}

.card-luxury::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30z' fill='none' stroke='%23D4AF37' stroke-width='0.3'/%3E%3Ccircle cx='30' cy='30' r='10' fill='none' stroke='%23D4AF37' stroke-width='0.3'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* Card with Top Gold Accent */
.card-accent-top {
    position: relative;
}

.card-accent-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pattern-gold), var(--pattern-teal), var(--pattern-gold));
    border-radius: 16px 16px 0 0;
}

/* ============================================
   ANIMATED BACKGROUND PATTERNS
   ============================================ */

/* Floating Pattern Animation */
.bg-pattern-float {
    position: relative;
    overflow: hidden;
}

.bg-pattern-float::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='0.3'%3E%3Cpolygon points='50,10 90,35 90,65 50,90 10,65 10,35'/%3E%3Cpolygon points='50,25 75,40 75,60 50,75 25,60 25,40'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.02;
    animation: floatPattern 60s linear infinite;
    pointer-events: none;
}

@keyframes floatPattern {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Subtle Shimmer Effect */
.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(212, 175, 55, 0.1),
        transparent);
    animation: shimmerEffect 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerEffect {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ============================================
   BUTTON PATTERN ENHANCEMENTS
   ============================================ */

/* Premium Button with Pattern */
.btn-premium {
    position: relative;
    background: linear-gradient(135deg, var(--pattern-gold), #B8941F);
    border: none;
    overflow: hidden;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='5' y='5' width='10' height='10' transform='rotate(45 10 10)' fill='none' stroke='rgba(255,255,255,0.2)' stroke-width='0.5'/%3E%3C/svg%3E");
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .pattern-star-8::before,
    .pattern-arabesque::before,
    .pattern-zellige::before,
    .pattern-lattice::before,
    .pattern-quatrefoil::before {
        opacity: 0.02;
    }

    .corner-ornament::before,
    .corner-ornament::after {
        width: 20px;
        height: 20px;
    }

    .divider-ornate .ornament {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   DARK MODE PATTERN ADJUSTMENTS
   ============================================ */

@media (prefers-color-scheme: dark) {
    .pattern-star-8::before,
    .pattern-arabesque::before,
    .pattern-zellige::before,
    .pattern-lattice::before,
    .pattern-quatrefoil::before {
        opacity: 0.05;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .border-gold-animated::before,
    .border-teal-pulse::after,
    .bg-pattern-float::before,
    .shimmer-effect::after {
        animation: none;
    }
}
