/* General Styles */
body {
    font-family: 'Titillium Web', sans-serif;
    background-color: #2E3048;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

/* Header Styles */
header {
    width: 100%;
    background-color: transparent; /* Removed blue background */
    padding: 10px 0;
    display: flex;
    justify-content: center;
    margin-top: 30px; /* Changed from margin-bottom to margin-top */
}

#logo-header {
    max-width: 300px;
    margin-bottom: 20px; /* Applied as requested */
    min-width: 200px;
    width: 100%;
    /* Removed height: auto; - width constraints handle aspect ratio */
}

/* Card Container Styles */
.card {
    background-color: transparent;
    width: 350px; /* Adjust width as needed */
    height: 460px; /* Fixed height as requested */
    perspective: 1000px; /* Perspective for 3D effect */
    margin-bottom: 20px; /* Space below card */
    display: none; /* Initially hidden */
}

/* Card Inner Container - Handles the 3D flip */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

/* Card Flipped State */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Card Front and Back Faces */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    box-sizing: border-box; /* Include padding in width/height */
    display: flex; /* Use flexbox for content alignment */
    flex-direction: column;
    align-items: center;
}

/* Card Back Specifics */
.card-back {
    transform: rotateY(180deg);
    justify-content: space-between; /* Changed from center to space-between */
}

.back-profile {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.back-profile .profile-img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.back-profile .name {
    font-size: 1.2em;
    margin: 0;
    color: #2E3048;
}

/* Content Styling */
.card-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #00B25E; /* Example border color */
}

.name {
    margin: 10px 0 5px;
    font-size: 1.5em;
    color: #2E3048;
}

.title {
    margin: 0 0 15px;
    font-size: 1em;
    color: #555;
}

.contact-info p {
    margin: 8px 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    color: #444;
}

.contact-info p i {
    margin-right: 8px;
    color: #2E3048;
    width: 16px; /* Ensure icons align */
    text-align: center;
}

.contact-info a {
    color: #2E3048;
    text-decoration: none;
    word-break: break-all; /* Prevent long emails/links from overflowing */
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Buttons */
.buttons {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 10px; /* Spacing between buttons */
    justify-content: center;
}

.download-btn,
.download-btn:visited {
    background-color: #00B25E; /* Changed to green for download buttons */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex; /* Align icon and text */
    align-items: center;
    gap: 8px; /* Space between icon and text */
}

.download-btn.linkedin {
    background-color: #0077B5;
}

.download-btn.calendar {
    background-color: #b50051;
}

/* QR code button specific styling */
button.download-btn:nth-of-type(1),
.card-back .download-btn {
    background-color: #2E3048;
}

.download-btn:hover {
    background-color: #2E3048;
}

/* Download button hover states */
.download-btn[href*="vcard"]:hover {
    background-color: #00994F; /* Darker green for download button hover */
}

button.download-btn:nth-of-type(1):hover,
.card-back .download-btn:hover {
    background-color: #262842; /* Darker shade for QR button hover */
}

/* Loading Spinner */
#loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.2em;
    z-index: 1000;
}

#loading-spinner i {
    font-size: 2em;
}

/* QR Code container on back */
#qr-back {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Add some padding around the QR code */
}

#qr-back img {
    max-width: 100%;
    height: auto; /* Ensure QR code scales */
}


/* Error Page Styles */
#error-page {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none; /* Initially hidden */
    max-width: 400px;
    width: 90%;
    position: relative;
    z-index: 1000;
}

.error-icon {
    font-size: 3em;
    color: #dc3545; /* Red color for error */
    margin-bottom: 15px;
}

#error-message {
    color: #721c24; /* Darker red for text */
    background-color: #f8d7da; /* Light red background */
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    word-break: break-word;
    font-size: 1.1em;
    line-height: 1.4;
}

/* 404 Page Styles */
#not-found-page {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none; /* Initially hidden */
    max-width: 400px;
    width: 90%;
    position: relative;
    z-index: 1000;
}

.not-found-icon {
    font-size: 3em;
    color: #6c757d; /* Gray color for 404 */
    margin-bottom: 15px;
}

#not-found-page h2 {
    color: #495057;
    margin-bottom: 10px;
}

#not-found-page p {
    color: #6c757d;
    margin-bottom: 20px;
}

.home-btn {
    display: inline-block;
    background-color: #00B25E;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.home-btn:hover {
    background-color: #00994F;
}

/* Placeholder Styles */
#placeholder {

}

/* Copyright Styles */
.copyright {
    margin-top: auto; /* Push copyright to the bottom */
    padding: 15px;
    font-size: 0.8em;
    text-align: center;
    width: 100%;
}
.copyright a,.copyright a:visited {
    color: #e4e4e4;
}

/* Responsive Adjustments (Optional Example) */
@media (max-width: 480px) {
    .card {
        width: 90%; /* Make card wider on small screens */
    }

    #logo-header {
        max-width: 80%; /* Adjust logo size */
        min-width: 150px;
    }

    .name {
        font-size: 1.3em;
    }

    .title {
        font-size: 0.9em;
    }

    .contact-info p {
        font-size: 0.85em;
    }

    .buttons {
        gap: 8px;
    }

    .download-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}