body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 40px 20px;
    background-color: #f4f4f4; 
    color: #000; 
    text-align: center;
}

h1 {
    font-family: 'Roboto', sans-serif;
    margin: 0; 
    font-size: 2.5em; 
    background: linear-gradient(45deg, #28a745, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

h2 {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    font-size: 1.5em;
    color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    display: inline-block;
}


.header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0 auto 30px;
    max-width: 800px;
    padding: 15px 20px;
}


.header h1 {
    flex-grow: 1; 
    text-align: center; 
}


div {
    margin-top: 20px;
}


input[type="text"] {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 2px 12px rgba(40, 167, 69, 0.15);
}

#generateButton {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#generateButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

button {
    padding: 10px 15px;
    margin-left: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}


button:hover {
    background-color: #218838;
}


@media (max-width: 600px) {
    input[type="text"] {
        width: 100%; 
    }

    button {
        width: 100%; 
        margin-left: 0; 
        margin-top: 10px; 
    }
}


body.dark-mode {
    background-color: #333; 
    color: #fff; 
}

body.dark-mode input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

body.dark-mode input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode input[type="text"]:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

body.dark-mode button {
    background-color: #1e7e34; 
}

body.dark-mode button:hover {
    background-color: #155724; 
}

.switch {
    position: relative;
    width: 60px;
    height: 34px;
    margin-left: 15px;
}

.switch input {
    opacity: 0; 
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #28a745, #20c997);
    opacity: 0.8;
    border-radius: 34px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white; 
    transition: .4s;
    border-radius: 50%; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


input:checked + .slider {
    background: linear-gradient(45deg, #28a745, #20c997);
}

input:checked + .slider:before {
    transform: translateX(26px); 
}

.footer {
    margin: 20px 0; 
}

.footer p {
    margin: 0; 
}

.footer a {
    color: #2196F3; 
    text-decoration: none; 
}

.footer a:hover {
    text-decoration: underline; 
}



.receipt-container {
    display: none;
    position: relative;
    z-index: 1;
    background: white;
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 14px;
    word-break: break-word;
}

.receipt-item span:first-child {
    margin-right: 10px;
}

.receipt-item span:last-child {
    text-align: right;
    max-width: 50%;
}

.receipt-footer {
    border-top: 2px dashed #000;
    margin-top: 15px;
    padding-top: 10px;
    text-align: center;
}

.barcode {
    text-align: center;
    margin: 15px 0;
}

.download-btn, .share-btn {
    padding: 10px 20px;
    margin: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.share-btn {
    background: #007bff;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin: 10px auto;
    padding: 10px;
    max-width: 400px;
    border-radius: 4px;
    background-color: rgba(220, 53, 69, 0.1);
    display: none;
    transition: opacity 0.3s ease-in-out;
    position: relative;
    z-index: 3;
}

body.dark-mode .error-message {
    background-color: rgba(220, 53, 69, 0.2);
}

.buttons-container {
    display: none;
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 20px;
}

.served-by {
    text-align: center;
    color: #999;
    margin: 15px 0 5px 0;
    font-style: italic;
}

.generation-time {
    text-align: center;
    font-size: 12px;
    margin-bottom: 15px;
}

.coupon-code {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    border: 2px dashed #000;
    font-weight: bold;
    font-size: 16px;
}

.coupon-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.loading {
    text-align: center;
    margin: 20px 0;
    display: none;
}

body.dark-mode .receipt-container {
    background: #fff;
    color: #000;
}

.hero-section {
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.description-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: left;
    max-width: 800px;
}

.description-box h3 {
    color: #28a745;
    margin-bottom: 20px;
    font-size: 1.6em;
    text-align: center;
    font-weight: 600;
}

.description-box p {
    line-height: 1.7;
    margin: 15px 0;
    color: #444;
    font-size: 1.1em;
}

.description-box ul {
    list-style: none;
    padding: 0;
    margin: 25px 0;
}

.description-box li {
    margin: 15px 0;
    padding: 12px 15px;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1em;
    color: #2c3e50;
    transition: transform 0.2s ease;
}

.description-box li:hover {
    transform: translateX(5px);
    background: rgba(40, 167, 69, 0.1);
}

.feature-detail {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-weight: normal;
}

.description-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.description-note {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* Dark mode support */
body.dark-mode .description-box {
    background: rgba(40, 40, 40, 0.9);
}

body.dark-mode .description-box p {
    color: #e0e0e0;
}

body.dark-mode .description-box li {
    background: rgba(40, 167, 69, 0.15);
    color: #fff;
}

body.dark-mode .description-box li:hover {
    background: rgba(40, 167, 69, 0.25);
}

body.dark-mode .feature-detail {
    color: #aaa;
}

body.dark-mode .description-note {
    color: #999;
}

body.dark-mode .description-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .description-box {
        padding: 20px;
        margin: 15px 10px;
    }

    .description-box h3 {
        font-size: 1.4em;
    }

    .description-box p {
        font-size: 1em;
    }

    .description-box li {
        padding: 10px;
        font-size: 1em;
    }

    .feature-detail {
        font-size: 0.85em;
    }
}

.input-section {
    background: none;
    padding: 0;
    box-shadow: none;
    max-width: 600px;
    margin: 30px auto;
    display: flex;
    gap: 15px;
}

@media (max-width: 600px) {
    .description-box {
        padding: 15px;
        margin: 20px auto;
    }

    .hero-section {
        margin: 20px auto;
    }
}

.generate-another-btn {
    padding: 10px 20px;
    margin: 10px;
    background: #6c757d;  /* gray color */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.generate-another-btn:hover {
    background: #5a6268;
}

/* Add these styles for smooth transitions */
.hero-section, .receipt-container, .buttons-container, .input-section, .footer, h2 {
    transition: opacity 0.3s ease-in-out;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

.special-message {
    margin: 20px 0;
    padding: 15px;
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    font-style: italic;
    white-space: pre-line;
    text-align: center;
}

/* General responsive styles */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.2em;
    }

    .header {
        flex-direction: row;
        gap: 15px;
    }

    .input-section {
        padding: 0 10px;
    }

    input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
    }

    button {
        width: 100%;
        margin: 5px 0;
    }

    /* Receipt container responsive styles */
    .receipt-container {
        margin: 10px;
        padding: 15px;
        font-size: 14px;
    }

    .receipt-item {
        flex-direction: column;
        align-items: flex-start;
        margin: 10px 0;
    }

    .receipt-item span:first-child {
        margin-bottom: 5px;
    }

    .receipt-item span:last-child {
        max-width: 100%;
        text-align: left;
    }

    /* Buttons container responsive styles */
    .buttons-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    .download-btn, 
    .share-btn, 
    .generate-another-btn {
        width: 100%;
        margin: 0;
    }

    /* Description box responsive styles */
    .description-box {
        margin: 15px 10px;
        padding: 15px;
    }

    .description-box ul {
        padding-left: 0;
    }

    .description-box li {
        margin: 8px 0;
    }

    /* Barcode responsive style */
    .barcode svg {
        max-width: 100%;
        height: auto;
    }

    /* Special message responsive style */
    .special-message {
        margin: 15px 0;
        padding: 10px;
        font-size: 13px;
    }
}

/* Small phone screens */
@media (max-width: 380px) {
    h1 {
        font-size: 1.8em;
    }

    .receipt-container {
        margin: 5px;
        padding: 10px;
        font-size: 13px;
    }

    .coupon-code {
        font-size: 14px;
        padding: 8px;
    }
}

/* Print styles for better receipt printing */
@media print {
    body {
        padding: 0;
        background: white;
    }

    .header,
    .input-section,
    .hero-section,
    .footer,
    .buttons-container {
        display: none !important;
    }

    .receipt-container {
        margin: 0;
        padding: 20px;
        box-shadow: none;
        max-width: 100%;
    }
}

.creator-info {
    margin: 15px 0 25px;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.creator-link, .support-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
    padding: 5px 15px;
}

.creator-link:hover, .support-link:hover {
    transform: translateY(-2px);
}

.creator-label {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 2px;
}

.creator-name {
    font-size: 1em;
    font-weight: 600;
    color: #2196F3;
}

.support-link {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding-left: 20px;
}

.support-icon {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.support-text {
    font-size: 0.9em;
    color: #28a745;
    font-weight: 500;
}

/* Dark mode support */
body.dark-mode h2 {
    color: #fff;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(32, 201, 151, 0.2) 100%);
}

body.dark-mode .creator-badge {
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .creator-label {
    color: #999;
}

body.dark-mode .creator-name {
    color: #3da8ff;
}

body.dark-mode .support-link {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .support-text {
    color: #2fb344;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h2 {
        font-size: 1.3em;
        padding: 8px 16px;
    }

    .creator-badge {
        padding: 6px 12px;
    }

    .support-text {
        font-size: 0.85em;
    }
}

@media (max-width: 380px) {
    .creator-badge {
        padding: 10px 15px;
    }

    .support-link {
        border-left: 1px solid rgba(0, 0, 0, 0.1);
    }

    body.dark-mode .support-link {
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
}

.input-section {
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
}

.loading, .error-message {
    margin-top: 15px;
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .creator-info {
        margin: 15px 10px;
        font-size: 0.85em;
    }
}

/* Updated loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(33, 33, 33, 0.95) 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: white;
    padding: 30px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

.loading-countdown {
    font-size: 72px;
    margin: 20px 0;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-family: 'Arial', sans-serif;
    background: linear-gradient(45deg, #28a745, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loading-message {
    margin-top: 20px;
}

.loading-text {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-subtext {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode support */
body.dark-mode .loading-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.97) 0%, rgba(20, 20, 20, 0.97) 100%);
}

/* Add pulse animation to the spinner */
@keyframes pulse {
    0% { box-shadow: 0 0 15px rgba(40, 167, 69, 0.3); }
    50% { box-shadow: 0 0 25px rgba(40, 167, 69, 0.5); }
    100% { box-shadow: 0 0 15px rgba(40, 167, 69, 0.3); }
}

.loading-spinner {
    animation: spin 1s linear infinite, pulse 2s infinite;
}

/* Add responsive styles */
@media (max-width: 768px) {
    .loading-content {
        padding: 20px;
        width: 90%;
        max-width: 320px;
    }

    .loading-countdown {
        font-size: 56px;
    }

    .loading-text {
        font-size: 20px;
    }

    .loading-subtext {
        font-size: 14px;
    }
}

/* Dark mode support */
body.dark-mode .input-section {
    background: none;
}

body.dark-mode input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

body.dark-mode input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-section {
        flex-direction: column;
        padding: 15px;
        margin: 20px 10px;
    }

    input[type="text"] {
        width: 100%;
        padding: 12px;
    }

    #generateButton {
        width: 100%;
        padding: 12px;
    }
}