/* cast.css - Improved Version */
.cast-section {
    position: relative;
    padding: 150px 3% 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    text-align: center;
    z-index: 1;
    background: linear-gradient(135deg, #1a3a5f 0%, #295b78 50%, #1a3a5f 100%);
}
html,body{
    overflow-x: hidden;
}

.cast-header {
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
}

.cast-section h2 {
    font-size: 2.6rem;
    color: #f2c94c;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative; /* Changed from fixed to relative */
    top: 0px; /* Remove fixed positioning */
    left: 0px; /* Remove fixed positioning */
    transform: none; /* Remove centering transform */
    margin: 0 0 20px 0; /* Add bottom margin */
    z-index: 10;
    background: none;
    box-shadow: none;
    width: 100%;
}
.section-subtitle {
    font-size: 1.2rem;
    color: #e6e6e6;
    max-width: 600px;
    margin: 0 auto ;
    font-weight: 300;
    line-height: 1.6;
    padding: 0 20px; 
}

.cast-section h2::after {
    content: "";
    display: block;
    width: 25%;
    height: 4px;
    background: linear-gradient(90deg, #f2c94c, #56baa4);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ===== BACKGROUND JCI LOGO ===== */
.cast-section::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/Home/jci logo-black and white.png');
    background-repeat: no-repeat;
    background-position: center 12vh;
    background-size: contain;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
    filter: brightness(0.2) invert(1) blur(0.5px);
}

/* ===== للشاشات الكبيرة ===== */
@media (min-width: 992px) {
    .cast-section::before {
        background-position: center 9vh;
        background-size: contain;
    }
    .cast-section h2::after {
        width: 40%; /* Slightly wider on mobile */
        margin: 12px auto 0;
    }
}
@media (min-width:820px) {
    .cast-section::before {
        background-position: center 9vh;
        background-size: contain;
    }
    .cast-section h2::after {
        width: 40%; /* Slightly wider on mobile */
        margin: 12px auto 0;
    }
}

.cast-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
    padding: 0 20px;
}

.cast-card {
    width: 100%;
    max-width: 300px;
    height: 320px;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}



.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
}

.card-front {
    background: linear-gradient(135deg, #295b78 0%, #4268a6 100%);
    color: white;
}

.card-back {
    background: linear-gradient(135deg, #56baa4 0%, #2596be 100%);
    color: white;
    transform: rotateY(180deg);
}

.member-avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.member-avatar i {
    font-size: 2.6rem;
    color: rgba(255, 255, 255, 0.8);
}

.card-front h3 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: #ffffff;
    font-weight: 600;
}

.card-front p {
    margin: 0;
    color: #e6e6e6;
    font-size: 1rem;
    font-weight: 400;
}

.card-back h3 {
    font-size: 1.4rem;
    margin: 0 0 5px 0;
    color: #ffffff;
    font-weight: 600;
}

.card-back p {
    margin: 0 0 15px 0;
    color: #e6e6e6;
    font-size: 0.95rem;
    font-weight: 400;
}





/* Responsive Design */
@media (max-width: 768px) {
    .cast-section {
        padding: 130px 15px 50px;
    }
    
    .cast-section h2 {
        font-size: 2.2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }
    
    .cast-card {
        height: 300px;
    }
    .cast-section h2::after {
        width: 40%; /* Slightly wider on mobile */
        margin: 12px auto 0;
    }
    
}

@media (max-width: 480px) {
    .cast-section {
        padding: 120px 10px 30px;
    }
    
    .cast-section h2 {
        font-size: 1.8rem;
    }
    .section-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .cast-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cast-card {
        max-width: 100%;
    }
    .cast-section h2::after {
        width: 50%; /* Even wider on very small screens */
        margin: 10px auto 0;
    }
    
}
/* Tablets and Mobile Menu - UPDATED TO 1024px */
@media (max-width: 1024px) {
    .mobile-menu-button {
        display: flex;
    }
    
    .nav-buttons {
        display: none;
    }
    
    .logo img {
        height: 50px;
    }
    
    .navbar {
        padding: 10px 20px;
        flex-wrap: wrap;
    }
    
    .nav-buttons {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: #295b78;
        flex-direction: column;
        gap: 0;
        padding-top: 80px;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
        z-index: 1001;
        overflow-y: auto;
        display: flex;
    }
    
    .nav-buttons.active {
        transform: translateX(0);
    }
    
    .nav-buttons a, .dropbtn {
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: center;
        color: white;
        background: rgba(58, 16, 113, 0.1);
        font-size: 18px;
        text-decoration: none;
        display: block;
        cursor: pointer;
        border: none;
    }
    
    .nav-buttons a:hover, 
    .dropbtn:hover {
        background: rgba(58, 16, 113, 0.3);
        
    }
    
    .dropdown {
        position: relative;
        width: 100%;
    }
    
    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        background: rgba(0,0,0,0.2);
        box-shadow: none;
        border-radius: 0;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        padding: 15px 20px 15px 40px;
        color: #e0e0e0;
        font-size: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        text-align: left;
    }
    
    .dropdown-content a:hover {
        background: rgba(255,255,255,0.1);
        
    }
    
    .dropdown > .dropbtn::after {
        content: '▼';
        float: right;
        font-size: 12px;
        transition: transform 0.3s;
    }
    
    .dropdown.active > .dropbtn::after {
        transform: rotate(180deg);
    }
    
    .dropdown:not(.active) .dropdown-content {
        display: none !important;
    }
}
@media (max-width: 1024px) {
    .nav-buttons .cast-button {
        background: none;
        background-color: rgb(58, 16, 113, 0.1);
        color: #ffffff !important;
        border: none;
        box-shadow: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 18px;
        text-transform: none;
        padding: 12px 18px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: center;
        flex-direction: row;
    }

    .nav-buttons .cast-button img {
        width: 26px !important;
        height: auto !important;
        filter: brightness(0) invert(1) !important;
        margin-left: 8px !important;
    }
    

    .nav-buttons .cast-button:hover {
        background: rgba(58, 16, 113, 0.3);
        transform: none;
        box-shadow: none;
    }
    .dropdown {
        position: relative;
        width: 100%;
    }
    
    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        background: rgba(0,0,0,0.2);
        box-shadow: none;
        border-radius: 0;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown-content a {
        padding: 15px 20px 15px 40px;
        color: #e0e0e0;
        font-size: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        text-align: left;
    }
    
    .dropdown-content a:hover {
        background: rgba(255,255,255,0.1);
        
    }
    
    .dropdown > .dropbtn::after {
        content: '▼';
        float: right;
        font-size: 12px;
        transition: transform 0.3s;
    }
    
    .dropdown.active > .dropbtn::after {
        transform: rotate(180deg);
    }
    
    .dropdown:not(.active) .dropdown-content {
        display: none !important;
    }
    
}
/* Profile Picture Styles */
.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none; /* Hidden by default, will be shown if image loads */
    position: absolute;
    top: 0;
    left: 0;
}

.fallback-icon {
    display: block; /* Visible by default */
    position: relative;
    z-index: 1;
}

.member-avatar.has-image .fallback-icon {
    display: none; /* Hide icon when image is present */
}

.member-avatar.has-image .profile-pic {
    display: block; /* Show image when available */
}

.member-avatar {
    position: relative;
    overflow: hidden;
}



/* ===== LOADING STATE ===== */
.loading-message {
    text-align: center;
    padding: 100px 100px 100px 100px;
    color: #ffffff;
    font-size: 1.2rem;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #F2C94C;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 20px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-icon {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error-message h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.error-message p {
    margin-bottom: 25px;
    line-height: 1.5;
    font-size: 1.1rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #F2C94C;
    color: #2c3e50;
}

.btn-primary:hover {
    background-color: #e6b800;
    transform: translateY(-2px);
}