/* ========================================
   شركة المعدن الليبي - Custom Styles
   Color Scheme: Red, Black, White
   ======================================== */

:root {
    /* Primary Colors */
    --primary-red: #c41e3a;
    --primary-red-dark: #a01830;
    --primary-red-light: #e63950;
    --accent-red: #d62839;
    
    /* Neutrals */
    --black: #0d0d0d;
    --black-soft: #1a1a1a;
    --dark-gray: #2d2d2d;
    --gray: #4a4a4a;
    --light-gray: #8a8a8a;
    --white: #ffffff;
    --white-soft: #f8f8f8;
    
    /* Gradients */
    --gradient-dark: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #2d2d2d 100%);
    --gradient-red: linear-gradient(135deg, #a01830 0%, #c41e3a 50%, #e63950 100%);
    --gradient-hero: linear-gradient(135deg, rgba(13, 13, 13, 0.95) 0%, rgba(196, 30, 58, 0.3) 100%);
    
    /* Typography */
    --font-arabic: 'Cairo', sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.25s ease;
    
    /* Spacing */
    --section-padding: 100px 0;
    --container-max: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    background-color: var(--white-soft);
    color: var(--black);
    overflow-x: hidden;
}

body.loading {
    overflow: hidden;
}

/* ========== Loader ========== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    max-width: 180px;
    margin-bottom: 30px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ========== Navigation ========== */
.navbar {
    padding: 15px 0;
    transition: var(--transition-smooth);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(13, 13, 13, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    padding: 10px 0;
}

.nav-logo {
    height: 50px;
    width: auto;
}

.navbar .nav-link {
    color: var(--white) !important;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px !important;
    transition: var(--transition-fast);
    position: relative;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 20px;
    left: 20px;
    height: 2px;
    background: var(--primary-red);
    transform: scaleX(0);
    transition: var(--transition-fast);
    border-radius: 2px;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    transform: scaleX(1);
}

.navbar .nav-link:hover {
    color: var(--primary-red-light) !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========== Hero Section ========== */
.hero-section {
    position: relative;
    min-height: 100vh;
    background: var(--gradient-dark);
    background-image: 
        var(--gradient-hero),
        url('../photos/photo%20(1).jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 13, 13, 0.9) 0%, rgba(196, 30, 58, 0.25) 50%, rgba(13, 13, 13, 0.85) 100%);
    z-index: 1;
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-logo-img {
    max-width: 320px;
    width: 100%;
    filter: drop-shadow(0 10px 40px rgba(196, 30, 58, 0.4));
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 400;
}

.btn-hero {
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    margin: 0 10px 10px 0;
    transition: var(--transition-smooth);
    text-transform: none;
}

.btn-primary {
    background: var(--gradient-red);
    border: none;
    box-shadow: 0 8px 25px rgba(196, 30, 58, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(196, 30, 58, 0.5);
    background: linear-gradient(135deg, #c41e3a 0%, #e63950 100%);
    border: none;
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-red) !important;
    transform: translateY(-3px);
    border-color: var(--white);
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-indicator {
    color: var(--white);
    font-size: 2rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
    display: inline-block;
}

.scroll-indicator:hover {
    color: var(--primary-red-light);
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ========== Animations ========== */
.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-slide-up {
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-up.delay-1 { animation-delay: 0.2s; }
.animate-slide-up.delay-2 { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Section Styles ========== */
.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-badge {
    display: inline-block;
    background: var(--gradient-red);
    color: var(--white);
    padding: 8px 25px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--black);
    margin-bottom: 15px;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: var(--gradient-red);
    margin: 0 auto;
    border-radius: 2px;
}

/* ========== About Section ========== */
.about-section {
    background: var(--white);
}

.about-text {
    color: var(--gray);
    line-height: 2;
    margin-bottom: 25px;
}

.about-features {
    list-style: none;
    padding: 0;
}

.about-features li {
    padding: 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
}

.about-features li:hover {
    transform: translateX(-5px);
    color: var(--primary-red);
}

.about-features li i {
    color: var(--primary-red);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.about-image-wrapper {
    position: relative;
}

.about-img {
    transition: var(--transition-smooth);
}

.about-image-wrapper:hover .about-img {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2) !important;
}

.about-badge {
    position: absolute;
    bottom: -20px;
    left: 20px;
    background: var(--gradient-red);
    color: var(--white);
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.4);
}

.badge-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
}

/* ========== Services Section ========== */
.services-section {
    background: var(--black);
    color: var(--white);
}

.services-section .section-title {
    color: var(--white);
}

.service-card {
    background: var(--black-soft);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    height: 100%;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-red);
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(196, 30, 58, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 2rem;
    transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.5);
}

.service-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--white);
}

.service-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ========== Gallery Section ========== */
.gallery-section {
    background: var(--white-soft);
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(196, 30, 58, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.gallery-overlay i {
    font-size: 3rem;
    color: var(--white);
    transform: scale(0.5);
    transition: var(--transition-smooth);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

/* Lightbox */
.modal-content {
    background: transparent !important;
}

.modal-image {
    border-radius: 10px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* ========== Contact Section ========== */
.contact-section {
    background: var(--white);
}

.contact-info-card {
    background: var(--gradient-dark);
    color: var(--white);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.contact-info-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-red-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-info-card h3:not(:first-child) {
    margin-top: 30px;
}

.contact-info-card h3 i {
    font-size: 1.5rem;
}

.contact-info-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
}

.contact-info-card a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-info-card a:hover {
    color: var(--primary-red-light);
}

.map-wrapper {
    height: 100%;
    min-height: 350px;
}

.map-placeholder {
    background: var(--black-soft);
    border-radius: 20px;
    height: 100%;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    border: 2px dashed rgba(196, 30, 58, 0.3);
}

.map-placeholder i {
    font-size: 4rem;
    color: var(--primary-red);
    margin-bottom: 20px;
    opacity: 0.7;
}

.map-placeholder p {
    margin: 5px 0;
    font-size: 1.2rem;
}

/* ========== Footer ========== */
.footer {
    background: var(--black);
    color: var(--white);
}

.footer-logo {
    height: 60px;
    width: auto;
    opacity: 0.9;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-domain {
    color: var(--primary-red-light);
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 5px;
}

/* ========== Scroll Animations ========== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Responsive ========== */
@media (max-width: 991px) {
    :root {
        --section-padding: 70px 0;
    }
    
    .hero-section {
        background-attachment: scroll;
    }
    
    .hero-logo-img {
        max-width: 250px;
    }
    
    .about-badge {
        position: relative;
        bottom: auto;
        left: auto;
        display: inline-block;
        margin-top: 20px;
    }
    
    .contact-info-card {
        padding: 35px 25px;
    }
}

@media (max-width: 767px) {
    :root {
        --section-padding: 60px 0;
    }
    
    .nav-logo {
        height: 40px;
    }
    
    .hero-logo-img {
        max-width: 200px;
    }
    
    .btn-hero {
        display: block;
        margin: 10px auto;
    }
    
    .service-card {
        padding: 30px 20px;
    }
    
    .gallery-item {
        aspect-ratio: 16/10;
    }
}

/* ========== Gallery Reveal Animation ========== */
.gallery-item {
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
