body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    word-break: break-word;
    color: #343a40;
    line-height: 1.6;
    overflow-x: hidden;
}

.banner {
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    padding: 10px 0;
}

#bannerImage {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.container {
    max-width: 650px;
    margin: 20px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    overflow-wrap: break-word;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}

h1 {
    color: #212529;
    font-size: 2.2em;
    margin-bottom: 15px;
    font-weight: 700;
}

p {
    color: #495057;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    font-size: 1.05em;
}

input[type="tel"]#phoneNumber {
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    width: 250px;
    max-width: 90%;
    box-sizing: border-box;
    font-size: 17px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="tel"]#phoneNumber:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

input[type="tel"]#phoneNumber::placeholder {
    color: #868e96;
}

button, #confirmButton {
    padding: 15px 30px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

button:hover, #confirmButton:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

button:active, #confirmButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#confirmButton {
    background-color: #00a7e1;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 0.8px;
    box-shadow: 0 5px 12px rgba(0, 167, 225, 0.3);
    margin-bottom: 40px;
}

#confirmButton:hover {
    background-color: #008cc7;
    box-shadow: 0 7px 18px rgba(0, 167, 225, 0.4);
}

.validation-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: -10px;
    margin-bottom: 25px;
    display: none;
    text-align: center;
    overflow-wrap: break-word;
    font-weight: 500;
}

.service-provider-message {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.2em;
    color: #007bff;
    font-weight: bold;
    text-align: center;
}

#generateCardInstruction {
    font-size: 0.95em;
    color: #6c757d;
    margin-bottom: 15px;
    text-align: center;
    display: none;
}

.generate-card-button {
    background-color: #28a745;
    padding: 12px 24px;
    font-size: 1.1em;
    margin-top: 10px;
    margin-bottom: 20px;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.generate-card-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}

.data-card-generator-animation {
    background-color: #f0f8ff;
    border: 2px solid #007bff;
    padding: 20px;
    margin-top: 30px;
    border-radius: 12px;
    text-align: center;
    color: #343a40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.data-card-generator-animation .animation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.data-card-generator-animation p {
    margin-top: 15px;
    margin-bottom: 0;
    font-weight: 600;
    color: #0056b3;
    font-size: 0.9em;
}

.animated-code {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
    letter-spacing: 3px;
    filter: blur(12px);
    transition: filter 0.5s ease-out;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

@keyframes randomNumbers {
    0% { transform: translateY(0); opacity: 0.8; }
    25% { transform: translateY(-3px); opacity: 0.9; }
    50% { transform: translateY(0); opacity: 1; }
    75% { transform: translateY(3px); opacity: 0.9; }
    100% { transform: translateY(0); opacity: 0.8; }
}

.data-card-display {
    background-color: #e6ffe6;
    border: 2px dashed #4CAF50;
    padding: 25px;
    margin-top: 30px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1em;
    color: #343a40;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.data-card-display p {
    margin-bottom: 12px;
    font-weight: bold;
    color: #28a745;
}

.generated-code {
    font-size: 2.2em;
    font-weight: bold;
    color: #007bff;
    letter-spacing: 3px;
    word-break: break-all;
    user-select: all;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #cce5ff;
}

#copyDataCard {
    background-color: #17a2b8;
    padding: 12px 25px;
    font-size: 1.05em;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(23, 162, 184, 0.2);
}

#copyDataCard:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(23, 162, 184, 0.3);
}

#shareSection {
    margin-top: 30px;
    padding: 25px;
    background-color: #e2f0ff;
    border-radius: 12px;
    text-align: center;
    overflow-wrap: break-word;
    z-index: 1;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

#shareMessage {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #0056b3;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 8px;
    height: 30px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#progressBar {
    background-color: #28a745;
    height: 100%;
    width: 0%;
    border-radius: 8px;
    transition: width 0.4s ease-in-out;
}

#shareButton {
    background-color: #25d366;
    padding: 15px 30px;
    font-size: 1.1em;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

#shareButton:hover {
    background-color: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

.post-engagement {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fcfcfc;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.engagement-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    margin-bottom: 10px;
}

.engagement-left {
    display: flex;
    align-items: center;
}

.profile-circles {
    display: flex;
    margin-right: 10px;
}

.profile-circles div {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ccc;
    border: 1px solid #fff;
    margin-left: -5px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#circle1 {
    margin-left: 0;
}

.like-count {
    font-weight: 600;
    color: #495057;
    font-size: 0.85em;
    margin-right: 5px;
}

.engagement-counts {
    color: #6c757d;
    font-size: 0.75em;
}

.engagement-counts span + span {
    margin-left: 20px;
}

.engagement-separator {
    width: 90%;
    height: 1px;
    background-color: #e9ecef;
    margin-bottom: 10px;
}

.engagement-actions {
    display: flex;
    justify-content: space-around;
    width: 90%;
    gap: 20px;
    color: #495057;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
}

.engagement-actions span {
    transition: color 0.3s ease, transform 0.2s ease;
    text-transform: capitalize;
}

.engagement-actions span:hover {
    text-decoration: none;
    color: #007bff;
    transform: translateY(-1px);
}

.liked {
    color: #1877f2 !important;
    font-weight: bold;
}

#commentSection {
    margin-top: 10px;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

#commentSection h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #212529;
    font-size: 1.5em;
    font-weight: 700;
}

.comment {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background-color: #ffffff;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e0e0e0;
}

.comment-text-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    color: #007bff;
    display: block;
    margin-bottom: 4px;
    overflow-wrap: break-word;
    font-size: 1em;
}

.comment-text {
    color: #343a40;
    font-size: 0.9em;
    display: block;
    overflow-wrap: break-word;
    margin-bottom: 5px;
}

.comment-timestamp {
    font-size: 0.8em;
    color: #959595;
    margin-top: 5px;
    align-self: flex-start;
    white-space: nowrap;
}

.comment-input {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    gap: 15px;
}

.comment-input #userProfilePic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    grid-column: 1;
    grid-row: 1;
    border: 2px solid #e0e0e0;
}

.comment-input textarea {
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    resize: vertical;
    min-height: 50px;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow-wrap: break-word;
    grid-column: 2;
    grid-row: 1;
    box-sizing: border-box;
}

.comment-input textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.comment-input button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
    grid-column: 3;
    grid-row: 1;
}

.comment-input button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 1000;
}

.notification {
    background-color: #28a745;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.4s ease-out forwards;
    overflow-wrap: break-word;
    pointer-events: none;
    user-select: none;
    font-size: 0.95em;
    max-width: 280px;
    width: auto;
    text-align: left;
}

.notification.fade-out {
    animation: fadeOut 0.4s ease-in forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

#see-more-comments {
    display: block;
    margin: 20px auto 10px auto;
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f1f3f5;
    cursor: pointer;
    font-size: 0.95em;
    color: #495057;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    text-align: center;
    font-weight: 500;
}

#see-more-comments:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.loading-indicator {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 15px;
    color: #6c757d;
    font-size: 0.9em;
    font-weight: 500;
}

.spinner {
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bottom-ad-container {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #343a40;
    color: #f8f9fa;
    text-align: center;
    padding: 12px 0;
    z-index: 999;
    box-shadow: 0px -5px 15px rgba(0, 0, 0, 0.15);
}

.site-footer {
    margin-top: 50px;
    padding: 25px;
    background-color: #212529;
    color: #e0e0e0;
    text-align: center;
    font-size: 0.8em;
    border-top: 1px solid #495057;
}

.footer-links a {
    color: #a0d8ff;
    text-decoration: none;
    margin: 0 12px;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-links a:hover {
    color: #66b3ff;
}

.footer-separator {
    color: #6c757d;
}

.copyright {
    margin-top: 15px;
    color: #adb5bd;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 30px;
    border: none;
    border-radius: 12px;
    width: 85%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    position: relative;
    text-align: left;
    box-sizing: border-box;
}

.close-button {
    color: #6c757d;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #343a40;
}

#modalTitle {
    color: #212529;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 700;
}

#modalText {
    color: #495057;
    line-height: 1.7;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .container {
        margin: 15px;
        padding: 20px;
        max-width: calc(100% - 30px);
    }

    h1 {
        font-size: 1.8em;
    }

    input[type="tel"]#phoneNumber {
        width: calc(100% - 30px);
        max-width: 300px;
    }

    button, .generate-card-button, #shareButton, #copyDataCard {
        width: calc(100% - 30px);
        max-width: 300px;
        padding: 12px 20px;
        font-size: 1em;
    }

    #confirmButton {
        width: 250px;
        max-width: 250px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .engagement-top {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 90%;
        margin-bottom: 10px;
    }

    .engagement-left {
        display: flex;
        align-items: center;
        margin-right: 10px;
    }

    .profile-circles {
        display: flex;
        align-items: center;
        margin-right: 10px;
    }

    .like-count {
        white-space: nowrap;
    }

    .engagement-counts {
        display: flex;
        align-items: center;
    }

    .engagement-counts span + span {
        margin-left: 20px;
        margin-top: 0;
    }

    .engagement-actions {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: 90%;
        gap: 0;
    }

    .engagement-actions span {
        flex-grow: 1;
        text-align: center;
        padding: 5px 0;
        font-size: 1em;
    }

    .comment-input {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto;
        gap: 15px;
    }

    .comment-input #userProfilePic {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
    }

    .comment-input textarea {
        grid-column: 2;
        grid-row: 1;
        width: auto;
    }

    .comment-input button {
        grid-column: 3;
        grid-row: 1;
        width: auto;
    }

    .notification-container {
        bottom: 10px;
        right: 10px;
        align-items: flex-end;
    }

    .notification {
        max-width: 280px;
        width: auto;
        text-align: left;
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .modal-content {
        width: calc(100% - 40px);
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    h1 {
        font-size: 1.6em;
    }

    p {
        font-size: 0.95em;
    }

    .service-provider-message, #generateCardInstruction {
        font-size: 1em;
    }

    .generated-code {
        font-size: 1.8em;
        letter-spacing: 1px;
    }

    .site-footer {
        padding: 15px;
    }

    .footer-links {
        flex-direction: column;
        gap: 5px;
    }

    .notification {
        font-size: 0.85em;
        max-width: 250px;
    }

    #bannerImage {
        max-height: 150px;
    }
}

img {
    max-width: 100%;
    height: auto;
}
