/* CSS Variables for easier theme management */
:root {
    --primary-color: #007bff; /* Bootstrap primary blue */
    --secondary-color: #6c757d; /* Bootstrap secondary grey */
    --dark-bg-color: #343a40; /* Bootstrap dark navbar background */
    --light-text-color: #f8f9fa; /* Bootstrap light text color */
    --dark-text-color: #212529; /* Bootstrap dark text color */
    --accent-color-vaudeville-border: #8b4513; /* Vaudeville border color */
    --accent-color-vaudeville-text: #4b2e1e; /* Vaudeville text color */
    --vaudeville-gradient-start: #f8f1e4;
    --vaudeville-gradient-end: #e5d3b3;

    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.5);

    --border-radius-sm: 5px;
    --border-radius-md: 8px;
    --border-radius-lg: 15px;

    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
}

/* ========== Global & Base Styles ========== */
/* Universal font and consistent box model across all elements */
body, html {
    font-family: 'Arial', sans-serif; /* Keep Arial as specified, or consider a modern sans-serif like 'Inter' */
    box-sizing: border-box;
}

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

/* Base styles for the body to enable full-height flex layout and common properties */
body {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scrollbars */
    overflow-y: auto; /* Ensure scroll behavior is consistent */
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
    padding-bottom: 60px; /* Space for the fixed footer */
    perspective: 1000px; /* Establish 3D perspective for the body's children */
}

/* Common text color for pages with dark backgrounds (e.g., index, espanol) */
body.index, body.espanol {
    color: var(--light-text-color);
}

/* Specific background colors for non-image pages (e.g., work, about) */
body.work, body.about {
    background-color: bisque; /* Retained original color */
    color: initial;
}

.navbar {
    z-index: 1050;
    position: relative; /* Ensure navbar stays above main content */
    /* Added transparency to the navbar background */
    background-color: rgba(52, 58, 64, 0.8) !important; /* Use rgba for transparency, !important to override Bootstrap's bg-dark */
    backdrop-filter: blur(5px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    transition: background-color 0.3s ease; /* Smooth transition for background changes */
}

/* ========== Layout Utility ========== */
.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 56px; /* Adjusted based on fixed navbar height */
    padding-bottom: var(--spacing-lg);
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    word-wrap: break-word;
    flex-direction: column;
    text-align: center;
}

/* Styles for specific class combination */
.text-light.text-center.d-flex.align-items-center {
    min-height: auto;
    margin-bottom: 0;
}

/* Standard row margin for consistent spacing between rows */
.row {
    margin-bottom: var(--spacing-lg);
    width: 100%;
}

/* Column styling for centering content within */
.col-md-8 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ========== Page Specific Backgrounds ========== */

/* GLOBAL ::before for ALL background images */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    z-index: -3;
    /* Added filter for background depth */
    filter: brightness(0.7) contrast(1.2) blur(1px); /* Slightly darken, increase contrast, and add a subtle blur */
    transition: filter 0.5s ease, transform 0.5s ease; /* Smooth transition for transform */
    /* 3D Transform for depth - Increased scale to ensure fill */
    transform: translateZ(-100px) rotateX(2deg) rotateY(-2deg) scale(1.15); /* Push back, subtle tilt, and slightly scale up to fill view */
}

/* Specific background images for each page */
body.index::before {
    background-image: url('../img/trappers lake.svg');
}

/* CONTACT PAGE SPECIFIC BACKGROUND FIXES */
/* The main background image for contact page */
body.contact::before {
    background-image: url('../img/monumentvalley.svg');
    background-size: cover; /* Ensure it covers the screen explicitly */
    background-position: center center; /* Ensure it's centered */
}

/* Specific filter/overlay layer for the contact page background */
body.contact::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    filter: contrast(150%) brightness(110%);
    z-index: -2;
}

/* Mobile-specific adjustments for all fixed backgrounds */
@media (max-width: 767px) {
    body::before,
    body.contact::after {
        position: absolute; /* Change to absolute to scroll with content */
        height: 100vh; /* Explicitly set to viewport height on mobile */
        width: 100%; /* Fill the width of the body */
        background-attachment: scroll; /* Explicitly set to scroll on mobile */
        transform: none; /* Remove 3D transform on mobile for better performance/compatibility */
        filter: brightness(0.8) contrast(1.1); /* Reset filter for mobile */
    }

    /* Specific adjustment for the 'espanol' page background on mobile */
    body.espanol::before {
        background-size: contain;
        background-position: top center;
    }

    /* Explicitly ensure contact page background covers on mobile */
    body.contact::before {
        background-size: cover; /* Ensure it covers the mobile screen */
        background-position: center center;
    }
}


/* ========== Typography - Mobile First Approach ========== */
/* Base font size for the main heading - mobile first */
.main-page-title {
    font-size: 1.75rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-wrap: break-word;
    hyphens: auto;
    text-align: center;
    line-height: 1.2;
    margin: 0 auto;
    max-width: 100%;
    padding: 0 var(--spacing-sm);
    text-shadow: 2px 2px 4px var(--shadow-medium); /* Use variable for shadow */
}

/* Added text shadow for lead paragraph */
.lead {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); /* Retained specific RGBA for lead */
}


/* ========== Text Effects ========== */
@keyframes flashText {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
}

.flash-letter {
    display: inline-block;
    animation: flashText 0.3s ease-out forwards;
    animation-iteration-count: 3;
}

/* ========== Card Styles (Vaudeville Look) ========== */
.card.mb-4 {
    border: 8px double var(--accent-color-vaudeville-border);
    background: linear-gradient(to bottom right, var(--vaudeville-gradient-start), var(--vaudeville-gradient-end));
    box-shadow: 0 12px 24px var(--shadow-medium);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    position: relative;
    font-family: 'Georgia', serif;
    margin: 0 var(--spacing-sm);
    max-width: 100%;
    flex-shrink: 0;
}

.card.mb-4::before,
.card.mb-4::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('../img/corner-flourish.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.card.mb-4::before {
    top: -10px;
    left: -10px;
}

.card.mb-4::after {
    bottom: -10px;
    right: -10px;
}

.card.mb-4 .card-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color-vaudeville-text);
    text-shadow: 1px 1px 1px #fff;
    border-bottom: 2px dashed var(--accent-color-vaudeville-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.card.mb-4 .card-text {
    color: #3a2c1a; /* Retained specific color */
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.card.mb-4 img {
    border: 3px solid var(--accent-color-vaudeville-border);
    border-radius: var(--border-radius-sm);
    margin-top: 1rem;
    max-width: 100%;
    height: auto;
}

/* ========== Contact Form Styles ========== */
.contact-form {
    max-width: 95%;
    margin: var(--spacing-lg) auto;
    padding: var(--spacing-md);
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border: 1px solid #ccc;
    border-radius: 4px; /* Retained specific border-radius for inputs */
    box-sizing: border-box;
    font-size: 16px;
}

.contact-form button {
    width: 100%;
    padding: 12px 20px;
    background-color: #4CAF50; /* Retained specific color for success button */
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 4px; /* Retained specific border-radius for buttons */
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: #45a049; /* Retained specific color for success button hover */
}

/* ========== Modal Styles ========== */
.modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
    margin: 0.5rem;
}

@media (min-width: 576px) {
    .modal-dialog {
        min-height: calc(100% - 3.5rem);
        margin: 1.75rem auto;
    }
}

#statusModal .modal-content {
    border-left: 5px solid;
    background-color: #FFE4C4; /* Retained specific color */
}

#statusModal .modal-header,
#statusModal .modal-footer {
    background-color: var(--primary-color);
    color: white;
}

#statusModal .modal-body {
    background-color: #FFE4C4; /* Retained specific color */
}

#statusModal.success .modal-content {
    border-left-color: #28a745; /* Retained specific color */
}

#statusModal.error .modal-content {
    border-left-color: #dc3545; /* Retained specific color */
}

#statusModal.sending .modal-content {
    border-left-color: #17a2b8; /* Retained specific color */
}

.status-message {
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-weight: bold;
    margin-top: var(--spacing-sm);
}

.status-message.success {
    background-color: #d4edda; /* Retained specific color */
    color: #155724; /* Retained specific color */
    border: 1px solid #c3e6cb; /* Retained specific color */
}

.status-message.error {
    background-color: #f8d7da; /* Retained specific color */
    color: #721c24; /* Retained specific color */
    border: 1px solid #f5c6cb; /* Retained specific color */
}

.status-message.sending {
    background-color: #cce5ff; /* Retained specific color */
    color: #004085; /* Retained specific color */
    border: 1px solid #b8daff; /* Retained specific color */
}

/* ========== Social Buttons ========== */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    text-decoration: none;
    margin: var(--spacing-xs); /* 5px margin all around */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease; /* Added transform and box-shadow to transition */
    min-height: 44px; /* Ensure minimum touch target size */
    height: 44px; /* Explicit height for consistency */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle initial shadow */
    box-sizing: border-box; /* Ensure padding is included in height */
}

.social-btn:hover {
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

.social-btn:active {
    transform: translateY(0); /* Press effect */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); /* Reduced shadow on active */
}

.github-btn {
    background-color: #333;
    color: white;
}

.github-btn:hover {
    background-color: #24292e;
}

.linkedin-btn {
    background-color: #0077b5;
    color: white;
}

.linkedin-btn:hover {
    background-color: #005983;
}

.email-social-btn { /* New class for the email button's specific styling */
    background-color: var(--primary-color); /* Use primary color for email button */
    color: white;
    /* Ensure the email button's width is consistent with others if not forced to 100% */
    /* If w-100 is used in HTML, this max-width ensures it doesn't stretch too much on large screens */
    max-width: 250px; /* Example max-width, adjust as needed */
}

.email-social-btn:hover {
    background-color: #0056b3; /* Darker shade on hover */
}

.social-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    /* Ensure consistent icon color regardless of source (SVG or Font Awesome) */
    filter: brightness(0) invert(1); /* Makes icons white */
}

/* ========== Responsive Breakpoints ========== */
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .main-page-title {
        font-size: 2.25rem;
    }

    .card.mb-4 .card-title {
        font-size: 1.6rem;
    }

    .contact-form {
        max-width: 400px;
        padding: var(--spacing-lg);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .main-page-title {
        font-size: 2.75rem;
    }

    .card.mb-4 .card-title {
        font-size: 1.75rem;
    }

    .card.mb-4 .card-text {
        font-size: 1.1rem;
    }

    .main-content-wrapper {
        padding: 70px var(--spacing-xl) var(--spacing-lg);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .main-page-title {
        font-size: 3.5rem;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .main-page-title {
        font-size: 4rem;
    }
}

/* Mobile-specific adjustments (max-width: 767px is generally good for most mobiles) */
@media (max-width: 767px) {
    /* Ensure all text elements can wrap and handle overflows */
    h1, h2, h3, h4, h5, h6,
    .display-1, .display-2, .display-3, .display-4 {
        word-wrap: break-word;
        hyphens: auto;
        white-space: normal;
        text-align: center; /* Center headings on mobile */
        padding: 0 var(--spacing-sm);
    }

    /* Adjust display headings for mobile */
    .display-3 {
        font-size: 2rem;
    }

    /* Add padding to prevent content from touching screen edges for containers */
    .container, .container-fluid {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
}

/* ========== Depth and 3D Effects ========== */

/* Add depth to the profile image */
.img-fluid.rounded-circle {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), 0 6px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-in-out;
}

.img-fluid.rounded-circle:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Add depth to the main content container */
.main-content-wrapper .container {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle transparent background */
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl); /* Increased padding for better visual spacing */
    box-shadow: 0 15px 30px var(--shadow-strong), 0 10px 10px var(--shadow-medium);
    backdrop-filter: blur(5px); /* Add a subtle blur effect behind the content */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    transform-style: preserve-3d; /* Enable 3D transformations for children */
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg); /* Initial 3D context */
    transition: transform 0.5s ease-out;
}

/* Optional: Subtle tilt on hover for the container */
.main-content-wrapper .container:hover {
    transform: perspective(1000px) rotateX(1deg) rotateY(1deg);
}

/* Add depth to buttons */
.btn {
    box-shadow: 0 5px 10px var(--shadow-medium);
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* ========== Fixed Footer Styles ========== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--dark-bg-color); /* Dark background for the footer */
    color: var(--light-text-color); /* Light text for readability */
    text-align: center;
    padding: var(--spacing-md) 0; /* Vertical padding */
    font-size: 0.9rem;
    z-index: 1000; /* Ensure it stays above other content but below navbar */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3); /* Subtle shadow at the top edge */
}

/* Adjust body padding for mobile if footer takes up more space */
@media (max-width: 767px) {
    body {
        padding-bottom: 70px; /* Increase padding if footer is taller on mobile */
    }
}

/* ========== New Depth Effects for Work/Section Intro ========== */

/* Container for the introductory text on the work page/sections */
.intro-section-container {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle transparent background */
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl); /* Generous padding */
    box-shadow: 0 15px 30px var(--shadow-strong), 0 10px 10px var(--shadow-medium);
    backdrop-filter: blur(5px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(5px); /* For Safari */
    transform-style: preserve-3d; /* Enable 3D transformations for children */
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg); /* Initial 3D context */
    transition: transform 0.5s ease-out;
    margin-top: var(--spacing-xl); /* Add margin from top */
    margin-bottom: var(--spacing-xl); /* Add margin from bottom */
    width: 100%; /* Ensure it takes full width */
    max-width: 800px; /* Limit max width for better readability on large screens */
}

/* Optional: Subtle tilt on hover for the intro container */
.intro-section-container:hover {
    transform: perspective(1000px) rotateX(1deg) rotateY(1deg);
}

/* Heading for the section (e.g., "Here are Some Examples of my Work") */
.section-heading {
    font-size: 2.5rem; /* Adjust font size as needed */
    font-weight: bold;
    color: var(--dark-text-color); /* Changed to dark text color */
    text-shadow: 2px 2px 4px var(--shadow-medium); /* Add text shadow for depth */
    margin-bottom: var(--spacing-sm); /* Space below heading */
    text-align: center; /* Ensure it's centered */
}

/* Descriptive paragraph for the section */
.section-description {
    font-size: 1.1rem; /* Adjust font size as needed */
    color: var(--dark-text-color); /* Changed to dark text color */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); /* Add text shadow for depth */
    margin-bottom: var(--spacing-lg); /* Space below paragraph */
    text-align: center; /* Ensure it's centered */
}

/* Media query for mobile adjustments for new elements */
@media (max-width: 767px) {
    .intro-section-container {
        padding: var(--spacing-lg); /* Reduce padding on mobile */
        margin-top: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }

    .section-heading {
        font-size: 1.8rem; /* Adjust font size for mobile */
    }

    .section-description {
        font-size: 1rem; /* Adjust font size for mobile */
    }
}

/* ========== Contact Card Wrapper Styles ========== */
.contact-card-wrapper {
    background-color: rgba(255, 255, 255, 0.15); /* Slightly more opaque for better contrast */
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl); /* Generous padding around content */
    box-shadow: 0 15px 30px var(--shadow-strong), 0 10px 10px var(--shadow-medium);
    backdrop-filter: blur(8px); /* Increased blur for more frosted effect */
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.5s ease-out, background-color 0.3s ease;
    margin-top: var(--spacing-xl); /* Margin from top of page/previous content */
    margin-bottom: var(--spacing-xl); /* Margin from bottom/next content */
    width: 100%;
    max-width: 500px; /* Limit max width for a tighter wrap on larger screens */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border for definition */
    color: var(--light-text-color); /* Set default text color for the wrapper to whitesmoke */
}

.contact-card-wrapper:hover {
    transform: perspective(1000px) rotateX(1deg) rotateY(1deg);
    background-color: rgba(255, 255, 255, 0.2); /* Slightly more opaque on hover */
}

.contact-card-wrapper .contact-heading {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--light-text-color); /* Changed to light text color (whitesmoke) */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-lg);
}

.contact-card-wrapper .contact-details h2,
.contact-card-wrapper .contact-details p {
    color: var(--light-text-color); /* Changed to light text color (whitesmoke) */
    margin-bottom: var(--spacing-xs); /* Tighter spacing for contact lines */
}

.contact-card-wrapper .contact-details h2 {
    font-size: 1.8rem;
    margin-top: 0; /* Remove default h2 top margin */
}

.contact-card-wrapper .contact-details p {
    font-size: 1rem;
}

/* Adjust social buttons group within the contact card */
.contact-card-wrapper .social-buttons-group {
    margin-top: var(--spacing-lg); /* Space between contact info and buttons */
    width: 100%; /* Ensure the button group takes full width within the card */
}

/* Mobile adjustments for contact card */
@media (max-width: 767px) {
    .contact-card-wrapper {
        padding: var(--spacing-lg); /* Reduce padding on mobile */
        margin-top: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
        max-width: 95%; /* Adjust max width for mobile */
    }

    .contact-card-wrapper .contact-heading {
        font-size: 1.8rem;
    }

    .contact-card-wrapper .contact-details h2 {
        font-size: 1.5rem;
    }
}

/* ============================================================
   CERTIFICATIONS — HORIZONTAL SCROLL LIST
   ============================================================ */
.certs-scroll {
    display: flex;
    justify-content: center;      /* Centers cert icons */
    gap: 25px;
    padding: 10px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.cert-item {
    flex: 0 0 auto;               /* Keep fixed width */
    scroll-snap-align: center;
    text-align: center;
    cursor: pointer;
}

.cert-thumb {
    width: 130px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

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


/* ============================================================
   MODAL — SHOW FULL CERTIFICATION
   ============================================================ */
.modal {
    display: none;                /* Hidden until opened */
    position: fixed;
    inset: 0;                     /* Same as top/right/bottom/left: 0 */
    z-index: 9999;

    /* Soft overlay */
    background: rgba(0,0,0,0.1);  
    backdrop-filter: blur(2px);

    /* Align modal content to bottom of viewport */
    display: flex;
    justify-content: center;
    align-items: flex-end;

    padding: 20px;
}

.modal-content img {
    width: 80%;
    max-width: 2000px;
    height: auto;
    display: block;
    margin: auto;
}

/* Close button */
.close {
    position: absolute;
    top: 20px;
    right: 35px;
    font-size: 40px;
    color: black;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: #999;
}


/* ========== Footer Styles ========== */
footer {
    background-color: var(--dark-bg-color);
    color: var(--light-text-color);
    padding: var(--spacing-lg) 0;
    text-align: center;
    font-size: 0.9rem;
}