/* ============================================
   Branches Page - صفحة الفروع
   رحى المكان - تصميم عصري واحترافي
   ============================================ */

/* Reset & Root Variables */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #5D4037;
    --primary-dark: #3E2723;
    --primary-light: #8D6E63;
    --secondary: #D84315;
    --secondary-light: #FF5722;
    --accent: #FFC107;
    --accent-light: #FFD54F;

    /* Backgrounds */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-dark: linear-gradient(135deg, #5D4037 0%, #3E2723 50%, #4E342E 100%);

    /* Text */
    --text-primary: #2c2c2c;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(255, 193, 7, 0.3);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 50px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Hero Header
   ============================================ */
.hero-header {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-dark);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Floating Shapes */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 10s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--secondary);
    bottom: -50px;
    left: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--accent-light);
    top: 30%;
    left: 5%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    background: var(--text-white);
    bottom: 20%;
    right: 15%;
    animation-delay: 6s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    width: 100%;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.7rem 1.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    transform: translateX(8px);
}

.hero-text {
    max-width: 600px;
    margin: 0 auto;
}

.logo-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: var(--primary-dark);
    box-shadow: var(--shadow-glow);
    animation: pulse 2.5s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(255, 193, 7, 0.3);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 60px rgba(255, 193, 7, 0.5);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.3rem;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

/* Hero Wave */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: 60px;
}

/* ============================================
   Quick Navigation
   ============================================ */
.quick-nav {
    padding: 2rem 0;
    background: var(--bg-primary);
}

.quick-nav-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.quick-nav-item:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}

.quick-nav-item.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(93, 64, 55, 0.3);
}

.quick-nav-item.active i {
    color: var(--accent);
}

.quick-nav-item i {
    font-size: 1rem;
    transition: var(--transition-normal);
}

/* ============================================
   Branches Section
   ============================================ */
.branches-section {
    padding: 3rem 0 4rem;
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

/* Branch Card */
.branch-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--transition-slow);
    opacity: 0;
    transform: translateY(40px);
}

.branch-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.branch-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}

/* Card Glow Effect */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition-normal);
    pointer-events: none;
}

.branch-card:hover .card-glow {
    opacity: 1;
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(216, 67, 21, 0.3);
}

.featured-badge i {
    font-size: 0.7rem;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
}

.branch-number {
    font-size: 3rem;
    font-weight: 900;
    color: rgba(93, 64, 55, 0.08);
    line-height: 1;
    transition: var(--transition-normal);
}

.branch-card:hover .branch-number {
    color: rgba(93, 64, 55, 0.15);
}

.branch-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f5f0eb 0%, #ebe4dc 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    transition: var(--transition-bounce);
}

.branch-card:hover .branch-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-white);
    transform: rotate(-8deg) scale(1.1);
}

.branch-icon.university {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    color: var(--secondary);
}

.branch-card:hover .branch-icon.university {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: var(--text-white);
}

/* Card Body */
.card-body {
    padding: 0 1.5rem 1rem;
}

.branch-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    transition: var(--transition-normal);
}

.branch-card:hover .branch-name {
    color: var(--primary);
}

.branch-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.branch-location i {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Branch Features */
.branch-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.feature {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: linear-gradient(135deg, #faf8f6 0%, #f5f2ef 100%);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-light);
    transition: var(--transition-normal);
}

.feature i {
    font-size: 0.75rem;
    color: var(--secondary);
}

.branch-card:hover .feature {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-white);
}

.branch-card:hover .feature i {
    color: var(--accent);
}

/* Card Footer */
.card-footer {
    padding: 1rem 1.5rem 1.5rem;
}

.map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
}

.map-btn:hover .btn-shine {
    left: 100%;
}

.map-btn:hover {
    background: linear-gradient(135deg, var(--secondary) 0%, #bf360c 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(216, 67, 21, 0.35);
}

.map-btn i {
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.map-btn:hover i {
    transform: translateX(-4px);
}

/* Featured Card Style */
.branch-card.featured {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e8 100%);
    border: 2px solid rgba(255, 193, 7, 0.2);
}

.branch-card.featured:hover {
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 20px 50px rgba(255, 193, 7, 0.15);
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    padding: 3rem 0 4rem;
}

.contact-card {
    position: relative;
    background: var(--bg-dark);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    overflow: hidden;
}

.contact-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.contact-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--primary-dark);
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.4);
}

.contact-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.contact-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition-normal);
}

.contact-btn.instagram {
    background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
    color: var(--text-white);
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.35);
}

.contact-btn.instagram:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(225, 48, 108, 0.5);
}

/* Contact Decoration */
.contact-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.deco-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
}

.deco-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
}

.deco-circle:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 20%;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--primary-dark);
    padding: 2.5rem 0 2rem;
}

.footer-content {
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--text-white);
    font-size: 1.3rem;
    transition: var(--transition-normal);
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-5px) rotate(8deg);
    box-shadow: 0 8px 20px rgba(216, 67, 21, 0.4);
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .hero-header {
        min-height: 45vh;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.2rem;
        padding: 1.2rem 1.5rem;
        max-width: 320px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-divider {
        height: 30px;
    }

    .branches-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .branch-card {
        border-radius: var(--radius-lg);
    }

    .card-header {
        padding: 1.2rem 1.2rem 0.8rem;
    }

    .branch-number {
        font-size: 2.5rem;
    }

    .branch-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .card-body {
        padding: 0 1.2rem 0.8rem;
    }

    .branch-name {
        font-size: 1.35rem;
    }

    .card-footer {
        padding: 0.8rem 1.2rem 1.2rem;
    }

    .map-btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }

    .quick-nav-item {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }

    .contact-card {
        padding: 2.5rem 1.5rem;
    }

    .contact-title {
        font-size: 1.5rem;
    }

    .social-links a {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero-header {
        min-height: 40vh;
    }

    .hero-content {
        padding: 1.5rem 1rem;
    }

    .back-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.1rem;
        margin-bottom: 1.5rem;
    }

    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 1.7rem;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-stats {
        gap: 1rem;
        padding: 1rem 1.2rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .branches-section {
        padding: 2rem 0 3rem;
    }

    .branches-grid {
        gap: 1.2rem;
    }

    .branch-card {
        border-radius: var(--radius-md);
    }

    .card-header {
        padding: 1rem;
    }

    .branch-number {
        font-size: 2rem;
    }

    .branch-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        border-radius: var(--radius-sm);
    }

    .card-body {
        padding: 0 1rem 0.6rem;
    }

    .branch-name {
        font-size: 1.2rem;
    }

    .branch-location {
        font-size: 0.85rem;
    }

    .feature {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }

    .card-footer {
        padding: 0.6rem 1rem 1rem;
    }

    .map-btn {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }

    .featured-badge {
        top: 0.8rem;
        left: 0.8rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    .contact-section {
        padding: 2rem 0 3rem;
    }

    .contact-card {
        padding: 2rem 1.2rem;
        border-radius: var(--radius-lg);
    }

    .contact-icon {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
    }

    .contact-title {
        font-size: 1.3rem;
    }

    .contact-text {
        font-size: 0.95rem;
    }

    .contact-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 2rem 0 1.5rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-links a {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .copyright {
        font-size: 0.8rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-stats {
        flex-direction: row;
        gap: 0.8rem;
    }

    .stat-divider {
        height: 25px;
    }

    .branch-name {
        font-size: 1.1rem;
    }

    .quick-nav-grid {
        gap: 0.6rem;
    }

    .quick-nav-item {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .quick-nav-item span {
        display: none;
    }

    .quick-nav-item i {
        margin: 0;
    }
}

/* Animation Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus States for Accessibility */
.map-btn:focus,
.back-btn:focus,
.quick-nav-item:focus,
.contact-btn:focus,
.social-links a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--accent);
    color: var(--primary-dark);
}

/* Print Styles */
@media print {
    .hero-header {
        min-height: auto;
        padding: 2rem;
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .branch-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .floating-shapes,
    .hero-wave,
    .contact-decoration {
        display: none;
    }
}