/* Normalize and reset basic styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on mobile */
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.5;
    background-color: #fff;
    color: #000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Make images and videos responsive */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Remove default button styles */
button,
input,
textarea,
select {
    font: inherit;
    background: none;
    border: none;
    outline: none;
}

/* Remove tap delay on mobile */
a,
button {
    touch-action: manipulation;
}

/* Mobile-friendly layout helpers */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem;
}

/* Set up a default responsive layout */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.col {
    flex: 1 1 100%;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

/* Mobile Header Styles */
@media screen and (max-width: 768px) {

    /* Reset for mobile */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-size: 16px;
        line-height: 1.5;
        overflow-x: hidden;
    }

    /* Container adjustments */
    .container {
        width: 100% !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
    }

    /* Header Styles */
    .header {
        height: auto !important;
        padding: 10px 0 !important;
    }

    .header .logo a .content {
        display: flex;
        align-items: center;
    }

    .header .logo a .content img {
        width: 50px !important;
        height: 50px !important;
    }

    .header .logo a .content p {
        font-size: 16px !important;
    }

    /* Navigation */
    .header .nav {
        display: none;
        flex-direction: column !important;
        align-items: stretch !important;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        z-index: 1000;
        padding: 20px 0 10px 0;
        border-radius: 0 0 20px 20px;
        transition: 0.3s;
    }

    .header .nav.open {
        display: flex !important;
    }

    .header .nav .links {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 0 20px !important;
    }

    .header .nav .links li {
        width: 100% !important;
        margin: 0 !important;
    }

    .header .nav .links li a {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 15px 0 !important;
        background: #671475 !important;
        color: #fff !important;
        border-radius: 25px !important;
        font-size: 18px !important;
        margin-bottom: 8px !important;
        box-shadow: 0 2px 8px rgba(103, 20, 117, 0.08);
        border: none !important;
        transition: background 0.2s;
    }

    .header .nav .links li a:hover {
        background: #4e0e5e !important;
        color: #fff !important;
    }

    .header .nav .profile {
        margin: 10px 20px 0 20px !important;
        width: calc(100% - 40px) !important;
    }

    .header .nav .profile a,
    .header .nav .profile .profile-toggle {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 15px 0 !important;
        background: #671475 !important;
        color: #fff !important;
        border-radius: 25px !important;
        font-size: 18px !important;
        margin-bottom: 8px !important;
        border: none !important;
    }

    .header .nav .profile a:hover,
    .header .nav .profile .profile-toggle:hover {
        background: #4e0e5e !important;
        color: #fff !important;
    }

    .header .toggle-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        width: 35px !important;
        padding: 5px !important;
        cursor: pointer !important;
        z-index: 1100;
    }

    .header .toggle-menu span {
        height: 4px !important;
        background-color: #671475 !important;
        border-radius: 2px;
        transition: 0.3s;
    }

    /* إخفاء القائمة عند الضغط خارجها (يتم بالـ JS) */
}

/* تحسين شكل الهيدر نفسه على الموبايل */
@media (max-width: 768px) {
    .header {
        height: auto !important;
        padding: 10px 0 !important;
        background: #fff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    .header .container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .header .logo a .content img {
        width: 50px !important;
        height: 50px !important;
    }

    .header .logo a .content p {
        font-size: 18px !important;
        margin-right: 10px !important;
    }
}

/* Mobile Landing Styles */
@media (max-width: 768px) {
    .landing .text {
        width: 95%;
    }

    .landing .text h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .landing .text p {
        font-size: 16px;
    }

    .landing .text .search {
        width: 100%;
        font-size: 18px;
        padding: 10px;
    }
}

/* Mobile Operations Section */
@media (max-width: 768px) {
    .operations {
        padding: 30px 0;
    }

    .operations h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .operations .container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
        padding-bottom: 10px !important;
        justify-items: center !important;
        align-items: stretch !important;
    }

    .operations .option {
        min-width: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 15px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        box-shadow: 0 2px 8px rgba(103, 20, 117, 0.08);
        border-radius: 16px !important;
        background: #fff !important;
        aspect-ratio: 1/1 !important;
        /* يجعل المربع مربع الشكل دائماً */
        justify-content: flex-start !important;
    }

    .operations .option img {
        width: 70px !important;
        height: 70px !important;
        margin-bottom: 10px !important;
        display: block !important;
        align-self: center !important;
    }

    .operations .option h3 {
        font-size: 13px !important;
        min-height: auto !important;
        text-align: center !important;
    }

    .operations .option p {
        text-align: center !important;
    }

    /* شريط تمرير أنيق */
    .operations .container::-webkit-scrollbar {
        height: 6px;
        background: #eee;
        border-radius: 6px;
    }

    .operations .container::-webkit-scrollbar-thumb {
        background: #671475;
        border-radius: 6px;
    }
}

/* Mobile Contact Section */
@media (max-width: 768px) {
    .contact {
        padding: 30px 0;
    }

    .contact .container form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .contact form input,
    .contact form textarea {
        font-size: 16px;
        padding: 8px;
    }

    .contact form [type="submit"] {
        font-size: 18px;
    }
}

/* Mobile Footer Styles */
@media (max-width: 768px) {
    .footer .container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    .footer .links {
        justify-content: center;
    }

    .footer .links li {
        width: calc(50% - 10px);
        text-align: center;
    }

    .footer .links li a {
        font-size: 14px;
        padding: 5px 0;
    }
}

/* Mobile Form Styles */
@media (max-width: 768px) {

    .login,
    .signup {
        width: 95%;
        padding: 25px 20px;
    }

    .login h1,
    .signup h1 {
        font-size: 22px;
    }

    .login form input,
    .signup form input {
        height: 45px;
        font-size: 14px;
    }

    .login .other {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Mobile Search Image Section */
@media (max-width: 768px) {
    .search-image {
        padding: 20px 0;
    }

    .search-image .container {
        flex-direction: column;
    }

    .search-image .upload-section,
    .search-image .results-section {
        width: 100%;
    }
}

/* Mobile All People Section */
@media (max-width: 768px) {
    .all-people .filters {
        flex-direction: column;
        gap: 10px;
    }

    .all-people .filters select,
    .all-people .filters input {
        width: 100%;
    }

    .all-people .content {
        grid-template-columns: 1fr;
    }
}

/* Utility classes for mobile */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }

    .mt-1-mobile {
        margin-top: 1rem !important;
    }

    .mb-1-mobile {
        margin-bottom: 1rem !important;
    }
}

/* Fix for mobile navigation menu */
@media (max-width: 768px) {
    .header .nav {
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }

    .header .toggle-menu {
        display: flex;
        z-index: 1000;
    }
}

/* زر البحث في اللاندينج */
@media (max-width: 768px) {

    .landing .text .search,
    .landing-search-btn {
        width: 100% !important;
        font-size: 18px !important;
        padding: 12px !important;
        margin-top: 15px !important;
        border-radius: 8px !important;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .landing .text {
        width: 95% !important;
        padding: 20px 5px !important;
        left: 50% !important;
        top: 45% !important;
        transform: translate(-50%, -50%) !important;
    }

    .landing .text h1 {
        font-size: 22px !important;
        margin-bottom: 10px !important;
    }

    .landing .text p {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }

    .landing .text .search i {
        font-size: 18px !important;
        margin-right: 7px !important;
    }

    .operations .container {
        align-items: stretch !important;
    }


    .operations .option {
        aspect-ratio: unset !important;
        /* إلغاء الشكل المربع */
        min-height: 230px !important;
        /* ارتفاع مريح للكارت */
        padding: 15px 10px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        box-shadow: 0 2px 8px rgba(103, 20, 117, 0.08);
        border-radius: 16px !important;
        background: #fff !important;
    }

    .operations .option img {
        width: 75px !important;
        height: 75px !important;
        margin-bottom: 6px !important;
    }

    .operations .option h3 {
        font-size: 15.5px !important;
        margin: 4px 0 6px 0 !important;

        text-align: center !important;
    }

    .operations .option p {
        text-align: center !important;
    }

    .footer .container {
        flex-direction: column !important;
        gap: 20px !important;
        text-align: center !important;
    }

    .footer .links {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
    }

    .footer .links li {
        width: auto !important;
        margin: 5px !important;
    }

    .footer .links li a {
        font-size: 14px !important;
        padding: 5px 10px !important;
    }
}

/* Responsive video container */
@media (max-width: 768px) {
    .responsive-video {
        max-width: 100% !important;
        width: 100% !important;
        padding-bottom: 56.25% !important;
        /* 16:9 ratio */
        margin: 20px 0 !important;
        border-radius: 10px !important;
        background: #000 !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .responsive-video iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 180px !important;
        border: 0 !important;
        display: block !important;
    }
}