/* Projects page specific styles - Enhanced for PC */
:root {
    --glow-color-1: #00e5ff;
    --glow-color-2: #0077ff;
    --dark-bg: rgba(1, 4, 24, 0.95);
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #010418 0%, #001122 50%, #010418 100%);
    color: #fff;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Enhanced Video Section for PC */
.video-section {
    padding: 60px 40px;
    text-align: center;
    background: rgba(0, 17, 34, 0.8);
    margin: 40px 0;
    border-radius: 15px;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.video-section h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 40px;
    background: linear-gradient(135deg, #00E5FF, #00B8D4, #0097A7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-shadow: none;
    animation: projectsTitleFloat 10s ease-in-out infinite;
}

@keyframes projectsTitleFloat {

    0% {
        transform: translateX(0px) translateY(0px);
    }

    20% {
        transform: translateX(12px) translateY(-12px);
    }

    40% {
        transform: translateX(-10px) translateY(-8px);
    }

    60% {
        transform: translateX(8px) translateY(0px);
    }

    80% {
        transform: translateX(-6px) translateY(-10px);
    }

    100% {
        transform: translateX(0px) translateY(0px);
    }
}

.video-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(15px, 3vw, 30px);
    max-width: 1600px;
    margin: 0 auto;
    padding: clamp(10px, 2vw, 20px);
    width: 100%;
    box-sizing: border-box;
}

.video-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 229, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.video-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 229, 255, 0.4);
    border-color: rgba(0, 229, 255, 0.5);
}

.video-item h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    margin-bottom: 20px;
    color: var(--glow-color-1);
    font-weight: 700;
}

.video-summary {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.6;
    color: #E0F7FA;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 119, 255, 0.1);
    border-left: 3px solid var(--glow-color-1);
    border-radius: 5px;
    text-align: left;
}

.video-item video {
    width: 100%;
    height: clamp(200px, 25vw, 280px);
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
    transition: all 0.3s ease;
}

.video-item:hover video {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.6);
}

/* Enhanced Gallery Section for PC */
.gallery-section {
    padding: 60px 40px;
    text-align: center;
    background: rgba(0, 17, 34, 0.8);
    margin: 40px 0;
    border-radius: 15px;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.gallery-section h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 60px;
    background: linear-gradient(135deg, #00E5FF, #00B8D4, #0097A7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-shadow: none;
    animation: projectsTitleFloat 10s ease-in-out infinite;
}

/* ============================================
   GRID LAYOUT - 2 Columns (50% wider cards)
   ============================================ */
body.projects-page .gallery-section .gallery-container {
    display: grid !important;
    grid-template-columns: repeat(2, 2.25fr) !important;
    gap: 20px !important;
    max-width: 1800px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

/* ============================================
   CARD STYLES - Wider and Taller to fill space
   ============================================ */
/* Ensure anchor tags used as cards maintain proper styling */
body.projects-page .gallery-section a.gallery-card {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
}

body.projects-page .gallery-section .gallery-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 229, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 450px !important;
    width: 100% !important;
    max-width: none !important;
}

.gallery-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 229, 255, 0.3);
    border-color: rgba(0, 229, 255, 0.5);
}

/* ============================================
   IMAGE CONTAINER - Larger and Wider
   ============================================ */
.gallery-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
    background: transparent !important;
    border: 2px solid rgba(0, 229, 255, 0.3);
    border-bottom: none;
    flex-shrink: 0;
}

/* ============================================
   IMAGE STYLES - Well-focused in container
   ============================================ */
.gallery-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    transition: transform 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    background: transparent !important;
    filter: none !important;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.05);
}

/* ============================================
   CONTENT AREA
   ============================================ */
.gallery-content {
    padding: 25px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
}

.gallery-content h3 {
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    color: var(--glow-color-1);
    margin: 0 0 15px 0;
    font-weight: 700;
    line-height: 1.3;
    flex-shrink: 0;
}

.gallery-description {
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    color: rgba(224, 247, 250, 0.9);
    line-height: 1.7;
    margin: 0 0 10px 0;
    flex: 1;
    max-height: none;
    padding-right: 0;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Desktop (1400px+) */
@media (min-width: 1400px) {
    body.projects-page .gallery-section .gallery-container {
        gap: 30px !important;
        max-width: 2000px !important;
        grid-template-columns: repeat(2, 2.25fr) !important;
    }

    body.projects-page .gallery-section .gallery-card {
        min-height: 500px !important;
        max-width: none !important;
    }

    body.projects-page .gallery-section .gallery-image-container {
        height: 350px !important;
    }

    .gallery-section {
        padding: 80px 40px;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    body.projects-page .gallery-section .gallery-container {
        gap: 25px !important;
        max-width: 1900px !important;
        grid-template-columns: repeat(2, 2.25fr) !important;
    }

    body.projects-page .gallery-section .gallery-card {
        min-height: 480px !important;
        max-width: none !important;
    }

    body.projects-page .gallery-section .gallery-image-container {
        height: 340px !important;
    }

    .gallery-content {
        padding: 25px;
    }

    .gallery-content h3 {
        font-size: 1.4rem;
    }

    .gallery-description {
        font-size: 1.1rem;
        line-height: 1.7;
    }
}

/* Tablet (992px and below) */
@media (max-width: 992px) {
    body.projects-page .gallery-section .gallery-container {
        grid-template-columns: repeat(2, 2.25fr) !important;
        gap: 20px !important;
        max-width: 1100px !important;
    }

    body.projects-page .gallery-section .gallery-card {
        min-height: 420px !important;
        max-width: none !important;
    }

    body.projects-page .gallery-section .gallery-image-container {
        height: 300px !important;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    body.projects-page .gallery-section {
        padding: 40px 15px !important;
    }

    body.projects-page .gallery-section .gallery-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 10px !important;
        max-width: 700px !important;
    }

    body.projects-page .gallery-section .gallery-card {
        min-height: 400px !important;
        max-width: none !important;
    }

    body.projects-page .gallery-section .gallery-image-container {
        height: 300px !important;
    }

    .gallery-content {
        padding: 22px 15px 15px 15px;
    }

    .gallery-content h3 {
        font-size: clamp(1.2rem, 2vw, 1.5rem);
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    body.projects-page .gallery-section {
        padding: 30px 10px !important;
    }

    body.projects-page .gallery-section .gallery-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 5px !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    body.projects-page .gallery-section .gallery-card {
        min-height: 380px !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    body.projects-page .gallery-section .gallery-image-container {
        height: 280px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .gallery-image {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
        object-position: center !important;
    }

    .gallery-content {
        padding: 0 15px 15px 15px;
    }

    .gallery-content h3 {
        font-size: clamp(1.1rem, 2.5vw, 1.3rem);
        margin-bottom: clamp(10px, 2vw, 15px);
    }

    .gallery-description {
        font-size: clamp(0.9rem, 2.5vw, 1rem);
        line-height: 1.5;
        margin-bottom: clamp(12px, 3vw, 16px);
    }
}

/* ============================================
   IMAGE QUALITY OPTIMIZATIONS
   ============================================ */
.gallery-section img[src*="Images/"],
.projects-page img[src*="Images/"] {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    filter: none !important;
}

/* High-DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .gallery-image {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: auto !important;
    }
}

/* Ultra-high performance optimizations */
.gallery-card,
.gallery-image-container,
.gallery-image {
    will-change: transform !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
}

/* Reduce motion for better performance on low-end devices */
@media (prefers-reduced-motion: reduce) {

    .gallery-card,
    .gallery-image {
        transition: none !important;
        animation: none !important;
    }

    .gallery-card:hover {
        transform: none !important;
    }

    .gallery-image:hover {
        transform: none !important;
    }
}

/* Lazy loading animations and fallback styles */
.lazy-image {
    opacity: 0 !important;
    transition: opacity 0.6s ease-in-out !important;
}

.lazy-image.loaded {
    opacity: 1 !important;
}

/* Custom scrollbar for gallery descriptions */
.gallery-description::-webkit-scrollbar {
    width: 6px;
}

.gallery-description::-webkit-scrollbar-track {
    background: rgba(0, 229, 255, 0.1);
    border-radius: 3px;
}

.gallery-description::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.4);
    border-radius: 3px;
}

.gallery-description::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.6);
}

/* Specific fallback styles for low-quality images */
img[src*="chiquinquira_project.jpg"],
img[src*="gas_project.jpg"],
img[src*="Grupo Marte Training.jpg"],
img[src*="training.jpg"] {
    filter: contrast(1.2) brightness(1.1) saturate(1.1) !important;
    image-rendering: optimize-contrast !important;
}

/* High-quality image enhancements */
img[src*="bill_gates_project.jpg"],
img[src*="desminate_pacific_project2.jpg"],
img[src*="pacific_desminate_project.jpg"],
img[src*="saab_project.jpg"] {
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: optimize-contrast !important;
    filter: none !important;
}

/* Project Action Button - Matching About Page Style */
.gallery-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(45deg, var(--glow-color-1), var(--glow-color-2));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
    margin-top: auto;
}

.gallery-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 229, 255, 0.8);
}

/* Psychological Messages */
.psych-messages {
    position: relative;
    overflow: hidden;
    height: 80px;
    margin: 60px 0;
    display: flex;
    align-items: center;
    background: rgba(0, 17, 34, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.psych-messages p {
    position: absolute;
    white-space: nowrap;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--glow-color-1);
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
    animation: scroll-left 30s linear infinite;
    font-weight: 600;
}

.psych-messages p:nth-child(2) {
    animation-delay: -10s;
}

.psych-messages p:nth-child(3) {
    animation-delay: -20s;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Additional specificity overrides for Projects page */
body.projects-page .gallery-section .gallery-container,
body.projects-page .video-section .video-container {
    display: grid !important;
}

body.projects-page .gallery-section .gallery-card,
body.projects-page .video-section .video-item {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure all project images are always visible */
.gallery-section img[src*="Images/"],
.projects-page img[src*="Images/"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    background: transparent !important;
}

/* Specific fix for Bill Gates project image - remove any overlay effects */
.gallery-card img[src*="bill_gates_project.jpg"],
img[src*="bill_gates_project.jpg"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    background: transparent !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Remove any overlay effects from Bill Gates image container */
.gallery-card .gallery-image-container:has(img[src*="bill_gates_project.jpg"]) {
    background: transparent !important;
    border: none !important;
}

/* Remove any pseudo-element overlays that might affect the Bill Gates image */
.gallery-card:has(img[src*="bill_gates_project.jpg"])::before,
.gallery-card:has(img[src*="bill_gates_project.jpg"])::after {
    display: none !important;
}

/* Ensure Bill Gates image container has no background overlay */
.gallery-card:has(img[src*="bill_gates_project.jpg"]) .gallery-image-container {
    background: transparent !important;
    box-shadow: none !important;
}

/* Force Bill Gates image to be completely visible */
.gallery-card img[src*="bill_gates_project.jpg"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    background: none !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    clip-path: none !important;
}

/* Remove all potential overlay effects from Bill Gates image container */
.gallery-card:has(img[src*="bill_gates_project.jpg"]) .gallery-image-container {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    filter: none !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure Bill Gates card has no overlay effects */
.gallery-card:has(img[src*="bill_gates_project.jpg"]) {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Remove any pseudo-elements or overlays specifically for Bill Gates */
.gallery-card:has(img[src*="bill_gates_project.jpg"])::before,
.gallery-card:has(img[src*="bill_gates_project.jpg"])::after {
    content: none !important;
    display: none !important;
    background: none !important;
    opacity: 0 !important;
}

/* Force maximum visibility for Bill Gates image */
.gallery-card img[src*="bill_gates_project.jpg"],
.gallery-card:has(img[src*="bill_gates_project.jpg"]) .gallery-image {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    visibility: visible !important;
    display: block !important;
}

/* Override backdrop-filter and blur effects from main Style.css for Bill Gates image */
.gallery-card:has(img[src*="bill_gates_project.jpg"]) .gallery-card-front,
.gallery-card:has(img[src*="bill_gates_project.jpg"]) .gallery-card-back {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    background: transparent !important;
}

/* Remove any blur effects from Bill Gates image container */
.gallery-card:has(img[src*="bill_gates_project.jpg"]) .gallery-image-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Specific override for Bill Gates image to remove any styling from Style.css */
img[src*="bill_gates_project.jpg"] {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    visibility: visible !important;
    display: block !important;
    background: none !important;
    mix-blend-mode: normal !important;
}

/* Ensure Bill Gates image container has no backdrop effects */
.gallery-image-container:has(img[src*="bill_gates_project.jpg"]) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    background: transparent !important;
}

/* Video enhancements for better PC viewing */
@media (min-width: 1200px) {
    .video-item video {
        height: clamp(240px, 30vw, 350px) !important;
    }

    .video-item:hover video {
        transform: scale(1.08) !important;
    }
}

/* Video Container Responsive Breakpoints - Matching Gallery Section */

/* Tablet (992px and below) */
@media (max-width: 992px) {
    .video-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        max-width: 1100px !important;
    }

    .video-item {
        min-height: 420px !important;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .video-section {
        padding: 40px 15px !important;
    }

    .video-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 10px !important;
        max-width: 700px !important;
    }

    .video-item {
        min-height: 400px !important;
    }

    .video-item video {
        height: 220px !important;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .video-section {
        padding: 30px 10px !important;
    }

    .video-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 5px !important;
        max-width: 100% !important;
    }

    .video-item {
        min-height: 380px !important;
        padding: 15px !important;
    }

    .video-item video {
        height: 200px !important;
    }

    .video-item h3 {
        font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    }

    .video-summary {
        font-size: clamp(0.9rem, 2.5vw, 1rem);
        line-height: 1.5;
    }
}