/* Version 3.0 - Anti-Flicker Update */

/* Disable problematic transitions that may cause flickering */
* {
    -webkit-transform: none !important;
    transform: none !important;
}
/* UBC Color Palette */
:root {
    --ubc-blue: #002145;
    --ubc-blue-light: #0055B7;
    --ubc-blue-accent: #40B4E5;
    --ubc-grey: #5E869F;
    --white: #FFFFFF;
    --light-grey: #F5F5F7;
    --dark-grey: #1D1D1F;
    --text-grey: #86868B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-grey);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo h2 {
    color: var(--ubc-blue);
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-grey);
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--ubc-blue);
}

/* Language Selector */
.language-selector {
    margin-left: 20px;
}

.language-selector select {
    background: var(--white);
    border: 1px solid var(--ubc-blue);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--ubc-blue);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background: var(--ubc-blue);
    color: var(--white);
}

.language-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--ubc-blue-accent);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ubc-blue) 0%, var(--ubc-blue-light) 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 20px 20px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 40px;
    opacity: 0.9;
    font-style: italic;
    text-align: center;
    color: #64b4e5;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 20px auto 30px;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    text-align: center;
}

.hero-quote {
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.7;
}

.hero-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
}

.hero-section h3 {
    color: #64b4e5;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

.btn {
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn.primary {
    background: linear-gradient(135deg, #0066cc, #64b4e5);
    color: white;
    border: none;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.3);
}

.btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* About Section */
.about {
    padding: 100px 0;
    background-color: var(--light-grey);
}

.about h2 {
    text-align: center;
    font-size: 3rem;
    color: var(--ubc-blue);
    margin-bottom: 60px;
    font-weight: 600;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.about-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.about-card h3 {
    color: var(--ubc-blue);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Projects Section */
.projects {
    padding: 100px 0;
    background-color: var(--white);
}

.projects h2 {
    text-align: center;
    font-size: 3rem;
    color: var(--ubc-blue);
    margin-bottom: 60px;
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project-card.large {
    grid-column: span 2;
}

.project-card.medium {
    min-height: 300px;
}

.project-image {
    height: 750px;
    background: linear-gradient(135deg, var(--ubc-blue-accent), var(--ubc-blue-light));
    position: relative;
    overflow: hidden;
}

/* Aviation project specific height increase */
.project-card:first-child .project-image {
    height: 900px;
}

/* Increase overall aviation project card height to prevent content cutoff */
.project-card:first-child {
    min-height: 1300px;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--white);
    text-align: center;
    padding: 20px;
}

.image-placeholder p {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.image-placeholder small {
    opacity: 0.8;
}

.project-content {
    padding: 30px;
    position: relative;
}

.project-content h3 {
    color: var(--ubc-blue);
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.project-content p {
    color: var(--dark-grey);
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-note {
    font-size: 0.9rem;
    color: var(--text-grey);
    font-style: italic;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tag {
    background: var(--ubc-blue-accent);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--ubc-blue) 0%, var(--ubc-blue-light) 100%);
    color: var(--white);
}

.contact h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
    font-weight: 600;
}

.contact-content {
    text-align: center;
}

.contact-content p {
    font-size: 1.2rem;
    margin-bottom: 50px;
    opacity: 0.9;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.contact-item h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.contact-item p {
    opacity: 0.8;
}

/* Footer */
.footer {
    background-color: var(--dark-grey);
    color: var(--white);
    text-align: center;
    padding: 30px 0;
}

/* Image Upload Enhancements */
.image-placeholder {
    transition: all 0.3s ease;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 10px;
}

.image-placeholder:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

/* Aviation Gallery Vertical Styles */
.aviation-gallery-vertical {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 20px 5px 20px;
    max-width: 90%;
    margin: 0 auto;
}

.aviation-image-container {
    position: relative;
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-height: 430px;
    height: auto;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Further increase height for first aviation image (Cessna 150 Dashboard) */
.aviation-image-container:first-child {
    min-height: 480px;
    flex: 1.3;
}

/* Restore second aviation image height to previous good width */
.aviation-image-container:last-child {
    min-height: 450px;
    flex: 1.0;
}

/* Ensure both aviation images have consistent width scaling */
.aviation-image-container .aviation-image {
    transform: scale(1.1);
    transform-origin: center center;
}

.aviation-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.aviation-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    object-position: center center;
    margin: 0;
    padding: 0;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.aviation-image-container:hover .image-overlay {
    transform: translateY(0);
}

.image-overlay h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: white;
}

.image-overlay p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
    color: white;
}

/* Image Placeholder for Aviation */
.image-placeholder-new {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ubc-blue-accent), var(--ubc-blue-light));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
    min-height: 140px;
}

.image-placeholder-new h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: white;
}

.image-placeholder-new p {
    font-size: 14px;
    margin: 0 0 8px 0;
    opacity: 0.9;
    color: white;
}

.image-placeholder-new small {
    font-size: 12px;
    opacity: 0.8;
    font-style: italic;
    color: white;
}

/* Finance Image Container Styles */
.finance-image-container {
    position: relative;
    width: 90%;
    height: calc(100% - 40px);
    overflow: hidden;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 90%;
}

.finance-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    object-position: center center;
    margin: 0;
    padding: 0;
}

.finance-image-container:hover .finance-image {
    transform: scale(1.02);
}

.finance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 33, 69, 0.88) 0%,
        rgba(0, 85, 183, 0.82) 50%,
        rgba(64, 180, 229, 0.75) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(1px);
}

.finance-image-container:hover .finance-overlay {
    opacity: 1;
    pointer-events: auto;
}

.returns-highlight {
    text-align: center;
    color: white;
}

.returns-highlight h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: white;
    opacity: 0.9;
}

.return-percentage {
    font-size: 36px;
    font-weight: 700;
    color: #40B4E5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 10px 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.returns-highlight p {
    font-size: 12px;
    margin: 0;
    opacity: 0.8;
    color: white;
}

.risk-warning {
    background: rgba(255, 193, 7, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid rgba(255, 193, 7, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.risk-warning p {
    font-size: 12px;
    margin: 0;
    color: #000;
    font-weight: 600;
    text-shadow: none;
}

/* Finance Placeholder Styles */
.finance-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--ubc-blue);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.placeholder-content {
    text-align: center;
    color: var(--ubc-blue);
    padding: 20px;
}

.placeholder-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--ubc-blue);
}

.placeholder-content p {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: var(--ubc-grey);
}

.placeholder-content code {
    background: var(--ubc-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    display: block;
    margin: 10px 0;
}

.placeholder-content small {
    font-size: 11px;
    color: var(--text-grey);
    font-style: italic;
    display: block;
    margin-top: 10px;
}

/* Delete Button for Aviation Images */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.image-slot:hover .delete-btn {
    opacity: 1;
    transform: scale(1);
}

.delete-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.uploaded-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Apple-style animations */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

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

.scale-on-hover {
    transition: transform 0.3s ease;
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

/* Enhanced project cards */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 33, 69, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

/* Text overlay for images */
.project-image .text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.project-card:hover .text-overlay {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card.large {
        grid-column: span 1;
    }

    .nav-menu {
        display: none;
    }

    .about h2, .projects h2, .contact h2 {
        font-size: 2rem;
    }

    .project-image {
        height: 200px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }
}
