/* General Reset and Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', cursive; /* Retro pixelated font */
    background: #f0f0f0; /* Light vintage background */
    color: #333;
    overflow: hidden;
}

/* Header Styling */
header {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #222, #444); /* Gradient background */
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 1000;
    border-bottom: 4px solid #555; /* Subtle bottom border */
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-content h1 {
    margin: 0 0 15px;
    font-size: 28px; /* Larger for better prominence */
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.6); /* Enhanced shadow for text */
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #f0f0f0;
    text-decoration: none;
    font-size: 16px;
    text-transform: uppercase;
    padding: 10px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 12px; /* More rounded corners */
    transition: color 0.3s, background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

nav ul li a:hover {
    color: #222;
    background-color: #f0f0f0;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Added shadow on hover */
}

/* Scene and Cube Styling */
.scene {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    margin-top: 80px; /* Space for header */
}

.cube {
    width: 400px; /* Adjusted size */
    height: 400px; /* Adjusted size */
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(20deg);
    cursor: grab;
    transition: transform 0.6s ease, box-shadow 0.3s ease;
}

.cube:active {
    cursor: grabbing;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #f9f9f9; /* Slightly lighter for a cleaner look */
    border: 4px solid #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backface-visibility: hidden;
    border-radius: 12px; /* More rounded corners */
    box-sizing: border-box;
    transition: transform 0.8s ease, background-color 0.5s ease, box-shadow 0.3s ease;
    padding: 20px;
    overflow: hidden;
}

.cube-face:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Added shadow on hover */
}

/* Adjusted heading and text styles for a smoother look */
.cube-face h2 {
    font-size: 24px; /* Adjusted font size */
    color: #333;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); /* Softer shadow */
}

.cube-face p,
.cube-face form {
    font-size: 16px; /* Adjusted font size for readability */
    color: #333;
    margin: 0;
    padding: 0;
}

.cube-face form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
}

/* Form elements styling */
.cube-face input, 
.cube-face textarea, 
.cube-face button {
    padding: 12px;
    margin: 6px 0;
    border-radius: 6px; /* Slightly more rounded */
    border: 2px solid #000;
    width: 100%;
    background-color: #fff;
    color: #333;
    font-size: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.cube-face input:focus,
.cube-face textarea:focus {
    background-color: #f0f0f0;
    border-color: #888;
    outline: none;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2); /* Subtle focus shadow */
}

.cube-face button {
    background-color: #c0c0c0;
    color: #fff;
    cursor: pointer;
    border: 2px solid #000;
}

.cube-face button:hover {
    background-color: #b0b0b0;
    border-color: #666;
    transform: scale(1.05);
}

/* Cube Faces */
.cube-face.front  { transform: translateZ(200px); } /* Adjusted for smaller size */
.cube-face.back   { transform: rotateY(180deg) translateZ(200px); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(200px); }
.cube-face.right  { transform: rotateY(90deg) translateZ(200px); }
.cube-face.top    { transform: rotateX(90deg) translateZ(200px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(200px); }

/* Contact Me Section Styling */
.cube-face.back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centered content */
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.cube-face.back form {
    width: 100%;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cube-face.back .social-links {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center;
    gap: 20px;
    margin-top: 20px; /* Increased spacing */
}

.social-link img {
    width: 45px;
    height: auto;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.social-link img:hover {
    transform: scale(1.1);
    filter: brightness(1.2); /* Slightly brighten on hover */
}

/* Media Queries for Mobile Devices */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 22px;
    }

    nav ul li {
        margin: 0 10px;
    }

    nav ul li a {
        font-size: 14px;
        padding: 8px 16px;
    }

    .cube {
        width: 300px; /* Adjusted size for medium screens */
        height: 300px; /* Adjusted size for medium screens */
    }

    .cube-face h2 {
        font-size: 20px;
    }

    .cube-face p,
    .cube-face form {
        font-size: 16px;
    }

    .cube-face input, 
    .cube-face textarea, 
    .cube-face button {
        padding: 10px;
        margin: 5px 0;
        font-size: 14px;
    }

    .social-link img {
        width: 35px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 20px;
    }

    nav ul li {
        margin: 0 8px;
    }

    nav ul li a {
        font-size: 12px;
        padding: 6px 12px;
    }

    .cube {
        width: 250px; /* Further adjusted size for small screens */
        height: 250px; /* Further adjusted size for small screens */
    }

    .cube-face h2 {
        font-size: 18px;
    }

    .cube-face p,
    .cube-face form {
        font-size: 14px;
    }

    .cube-face input, 
    .cube-face textarea, 
    .cube-face button {
        padding: 8px;
        margin: 4px 0;
        font-size: 12px;
    }

    .social-link img {
        width: 30px;
    }
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
    opacity: 0; /* Start with opacity 0 */
    transition: opacity 0.5s ease; /* Smooth fade-in and fade-out */
}

.modal.show {
    display: block; /* Show modal */
    opacity: 1; /* Fully opaque */
}

.modal-content {
    background-color: #fff;
    margin: 15% auto; /* Centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px; /* Optional: max-width for larger screens */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: scale(0.8); /* Start smaller */
    opacity: 0; /* Start with opacity 0 */
    transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth scale and fade-in */
}

.modal.show .modal-content {
    transform: scale(1); /* Scale to normal size */
    opacity: 1; /* Fully opaque */
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
