/* ========================================
   RETRO 8-BIT CONTACT POPUP (BOTTOM RIGHT)
   Game Boy Console Style - Matching Hero Section
   ======================================== */

   .contact-modal-overlay {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9998;
    pointer-events: none;
    /* Prevent clipping of buttons positioned outside modal */
    overflow: visible;
}

.contact-modal-overlay.show {
    pointer-events: auto;
}

.contact-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-height: calc(100vh - 100px);
    /* Game Boy Body styling - matching .gameboy-body */
    background: linear-gradient(145deg, #a8b5a0 0%, #9ba896 50%, #8b9d83 100%);
    border-radius: 20px;
    padding: 1rem;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Courier New', monospace;
    transform: translateY(calc(100% + 40px));
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    /* Ensure buttons positioned outside aren't clipped */
    overflow: visible;
}

.contact-modal-overlay.show .contact-modal {
    transform: translateY(0);
    opacity: 1;
}

/* Minimize animation */
.contact-modal.minimized {
    /* Account for button space: 100px content + 20px for buttons (10px offset + 10px clearance) */
    transform: translateY(calc(100% - 120px)) !important;
    max-height: 100px;
    overflow: visible;
}

/* Hide form and social section when minimized */
.contact-modal.minimized .contact-modal-form,
.contact-modal.minimized .contact-social-section {
    display: none;
}

/* Ensure header is fully visible when minimized */
.contact-modal.minimized .contact-modal-header {
    margin-bottom: 0;
}

/* Hide subtitle when minimized to keep focus on title */
.contact-modal.minimized .contact-modal-subtitle {
    display: none;
}

/* Inner screen container - Dark bezel like gameboy-screen-container */
.contact-modal-screen {
    background: #2d3731;
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.6);
}

/* Screen scanline effect */
.contact-modal-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.05) 0px,
            transparent 1px,
            transparent 2px,
            rgba(0, 0, 0, 0.05) 3px);
    pointer-events: none;
    border-radius: 12px;
    z-index: 1;
}

/* Close button - Game Boy style */
.contact-modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, #8b3a3a, #6d2020);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    /* Increased z-index to ensure button is above everything and fully visible */
    z-index: 9999;
    border: none;
}

.contact-modal-close:hover {
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.contact-modal-close:active {
    transform: scale(0.95) translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Minimize button - Game Boy style */
.contact-modal-minimize {
    position: absolute;
    top: -10px;
    right: 32px;
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, #c9a037, #a07818);
    border-radius: 50%;
    color: #2d3731;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    /* Increased z-index to ensure button is above everything and fully visible */
    z-index: 9999;
    border: none;
}

.contact-modal-minimize:hover {
    transform: scale(1.1) translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.contact-modal-minimize:active {
    transform: scale(0.95) translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Header - Game Boy body color style */
.contact-modal-header {
    text-align: center;
    padding: 12px 12px 10px 12px;
    /* Matching Game Boy body color */
    background: linear-gradient(145deg, #a8b5a0 0%, #9ba896 50%, #8b9d83 100%);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 2;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.contact-modal-header:hover {
    background: linear-gradient(145deg, #b8c5b0 0%, #abb8a6 50%, #9bad93 100%);
}

.contact-modal-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3731;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
    margin: 0 0 4px 0;
}

.contact-modal-subtitle {
    font-size: 0.7rem;
    color: #2d3731;
    opacity: 0.8;
    letter-spacing: 1px;
    margin: 0;
}

/* Form styling - Game Boy screen background */
.contact-modal-form {
    position: relative;
    z-index: 2;
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    background: #9bbc0f;
    border-radius: 8px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Hide scrollbar but keep functionality */
.contact-modal-form::-webkit-scrollbar {
    width: 6px;
}

.contact-modal-form::-webkit-scrollbar-track {
    background: rgba(15, 56, 15, 0.1);
    border-radius: 3px;
}

.contact-modal-form::-webkit-scrollbar-thumb {
    background: rgba(15, 56, 15, 0.3);
    border-radius: 3px;
}

.contact-modal-form::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 56, 15, 0.5);
}

.contact-form-group {
    margin-bottom: 10px;
}

.contact-form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    color: #0f380f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.contact-form-input,
.contact-form-textarea {
    width: 100%;
    padding: 8px 10px;
    /* Darker input field like game screen inside the form */
    background: #8bac0f;
    border: 2px solid #0f380f;
    border-radius: 6px;
    color: #0f380f;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow:
        inset 0 2px 4px rgba(15, 56, 15, 0.4),
        0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.contact-form-input::placeholder,
.contact-form-textarea::placeholder {
    color: rgba(15, 56, 15, 0.5);
}

.contact-form-input:focus,
.contact-form-textarea:focus {
    outline: none;
    background: #7a9d0f;
    border-color: #0a2a0a;
    box-shadow:
        inset 0 2px 4px rgba(15, 56, 15, 0.5),
        0 0 0 2px rgba(15, 56, 15, 0.2);
}

.contact-form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Submit button - Game Boy action button style */
.contact-submit-btn {
    width: 100%;
    padding: 10px;
    /* Matching .button-a and .button-b style */
    background: linear-gradient(145deg, #2c3e2f, #1a2420);
    border: none;
    border-radius: 8px;
    color: #9bbc0f;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.contact-submit-btn:hover:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #aac91f;
}

.contact-submit-btn:active:not(:disabled) {
    transform: translateY(2px) scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.1s ease;
}

.contact-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Social links section - Game Boy body color style */
.contact-social-section {
    padding: 10px 12px;
    /* Matching Game Boy body color */
    background: linear-gradient(145deg, #a8b5a0 0%, #9ba896 50%, #8b9d83 100%);
    border-radius: 8px;
    margin-top: 0.75rem;
    position: relative;
    z-index: 2;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.contact-social-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: #2d3731;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.contact-social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    /* Game Boy button style */
    background: linear-gradient(145deg, #2c3e2f, #1a2420);
    border-radius: 50%;
    color: #8b9d83;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.contact-social-link:hover {
    transform: translateY(1px) scale(1.05);
    color: #9bbc0f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.contact-social-link:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .contact-modal {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        bottom: 10px;
        max-height: calc(100vh - 80px);
    }

    .contact-modal-title {
        font-size: 1.1rem;
        letter-spacing: 1.5px;
    }

    .contact-modal-subtitle {
        font-size: 0.7rem;
    }

    .contact-form-input,
    .contact-form-textarea {
        font-size: 0.85rem;
    }

    .contact-submit-btn {
        font-size: 0.9rem;
        padding: 10px;
    }

    .contact-social-link {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .contact-modal {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
}

/* Pixelated corners decoration - removed, not needed for Game Boy style */

/* Game Boy Logo on modal */
.contact-modal::after {
    content: 'CONTACT BOY';
    position: absolute;
    bottom: 8px;
    right: 12px;
    color: #5a6b5d;
    font-size: 0.6rem;
    font-weight: bold;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 5;
}