/* Enhanced Responsive Styles for EgyptGo */

/* ==========================================================================
   1. GENERAL RESPONSIVE IMPROVEMENTS
   ========================================================================== */

/* Base responsive settings */
html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    height: auto;
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* ==========================================================================
   2. ENHANCED ISLANDS SECTION
   ========================================================================== */

/* Islands improvements */
.islands {
    height: 100vh;
    position: relative;
    overflow: hidden;
    background-color: var(--body-color);
}

.islands__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 1.5s ease;
}

/* Scale effect on page load */
.islands:hover .islands__bg {
    transform: scale(1.05);
}

.bg__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.islands__container {
    text-align: center;
    position: relative;
    padding: 2rem;
    width: 100%;
    z-index: 3;
}

.islands__data {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 1rem;
    transform: translateY(0);
    transition: transform 0.6s ease;
    animation: fadeInUp 1s ease-out;
}

.islands:hover .islands__data {
    transform: translateY(-10px);
}

.islands__subtitle {
    font-size: clamp(1rem, 3vw, 2.5rem);
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeIn 0.8s 0.2s forwards;
}

.islands__title {
    font-size: clamp(2rem, 5vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeIn 0.8s 0.4s forwards;
}

.islands__description {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    max-width: 600px;
    margin: 0 auto;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeIn 0.8s 0.6s forwards;
}

/* Controls style enhancement */
.controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    z-index: 99;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.controls:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.controls__container {
    display: flex;
    align-items: center;
    column-gap: 0.75rem;
}

.controls__img {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: cover;
    border: 2px solid transparent;
}

.controls__img:hover {
    transform: scale(1.05);
    border-color: var(--first-color);
}

/* Active controls with better styling */
.swiper-slide-thumb-active {
    width: 50px;
    height: 50px;
    border: 2px solid var(--second-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

/* Animations for islands content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   3. IMPROVED RESPONSIVE HEADER & NAVIGATION
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: all 0.4s;
}

.scroll-header {
    background-color: var(--body-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav__logo {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 101;
    transition: all 0.3s ease;
}

.nav__logo:hover {
    transform: scale(1.05);
}

.nav__menu {
    position: relative;
}

/* Mobile menu adjustments */
@media screen and (max-width: 1023px) {
    .nav__menu {
        position: fixed;
        bottom: 1rem;
        background-color: var(--container-color);
        box-shadow: 0 8px 24px rgba(39, 69, 190, 0.15);
        width: 90%;
        left: 0;
        right: 0;
        margin: 0 auto;
        padding: 1.3rem 2rem;
        border-radius: 1.25rem;
        transition: 0.4s;
        z-index: 100;
    }

    .nav__list {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        row-gap: 0.25rem;
        font-size: 0.75rem;
        color: var(--text-color);
        transition: 0.3s;
    }

    .nav__link i {
        font-size: 1.25rem;
    }

    .nav__link span {
        font-size: 0.688rem;
    }
}

/* ==========================================================================
   4. RESPONSIVE CARD & CONTENT LAYOUTS
   ========================================================================== */

/* Popular Section */
.popular__container {
    display: grid;
    gap: 2rem;
    padding-top: 1rem;
}

.popular__card {
    background-color: var(--container-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popular__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.popular__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.popular__card:hover .popular__img {
    transform: scale(1.05);
}

.popular__data {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.popular__price {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--second-color);
}

.popular__title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.popular__description {
    font-size: 0.875rem;
    flex: 1;
}

/* Blog Cards */
.blog__card {
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--container-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.blog__image {
    position: relative;
    overflow: hidden;
}

.blog__img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog__card:hover .blog__img {
    transform: scale(1.05);
}

.blog__button {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    padding: 0.75rem;
    border-radius: 50%;
    background-color: var(--first-color);
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.blog__button:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-3px);
}

.blog__data {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog__description {
    font-size: 0.875rem;
    flex: 1;
    margin-bottom: 1rem;
}

.blog__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* ==========================================================================
   5. RESPONSIVE FORM ELEMENTS
   ========================================================================== */

/* Form elements */
input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--container-color);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--first-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(59, 88, 214, 0.25);
}

.card {
    background-color: var(--container-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   6. RESPONSIVE GRID LAYOUTS
   ========================================================================== */

/* Responsive grid settings */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ==========================================================================
   7. ENHANCED MEDIA QUERIES
   ========================================================================== */

/* Extra small devices */
@media (max-width: 575.98px) {
    .container {
        width: 100%;
        padding-right: 15px;
        padding-left: 15px;
    }

    .section {
        padding: 3rem 0 1.5rem;
    }

    .islands__container {
        padding: 1rem;
    }

    .islands__data {
        padding: 0.75rem;
    }

    .controls {
        padding: 0.25rem 0.5rem;
    }

    .controls__img {
        width: 35px;
        height: 35px;
    }

    .swiper-slide-thumb-active {
        width: 45px;
        height: 45px;
    }

    .blog__card,
    .popular__card {
        max-width: 100%;
    }
}

/* Small devices */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }

    .popular__container,
    .blog__content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Medium devices */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }

    .content__container {
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }
}

/* Large devices */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    .nav {
        height: 5rem;
    }

    .nav__list {
        column-gap: 2rem;
    }

    .nav__link {
        display: flex;
        align-items: center;
        column-gap: 0.5rem;
    }

    .nav__link i {
        display: none;
    }

    .nav__button {
        display: block;
    }
}

/* Extra large devices */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .section {
        padding: 7rem 0 2rem;
    }

    .section__title {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    .section__subtitle {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .islands__container {
        padding: 3rem;
    }

    .islands__data {
        padding: 2rem;
    }
}

/* Adjustments for tall mobile screens */
@media (max-height: 700px) and (max-width: 767.98px) {
    .islands {
        height: 85vh;
    }

    .islands__bg {
        height: 85vh;
    }
}

/* ==========================================================================
   8. TOUCH OPTIMIZATIONS
   ========================================================================== */

@media (hover: none) {
    /* Adjustments for touch devices */
    .card,
    .blog__card,
    .popular__card {
        transition: none;
    }

    .blog__card:hover,
    .popular__card:hover {
        transform: none;
    }

    .nav__link,
    .button,
    a {
        -webkit-tap-highlight-color: transparent;
    }

    /* Larger touch targets */
    .nav__link,
    .button,
    .blog__button,
    .controls__img {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
