* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 300;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

/* Promotional Banner */
.promo-banner {
    font-family: 'Quicksand', sans-serif;
    width: calc(100% + 40px);
    margin: -20px -20px 20px -20px;
}

.promo-banner-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Strikethrough pricing for discounts */
.price-original {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 0.9em;
    margin-right: 8px;
}

.price-discounted {
    color: #820458;
    font-weight: 700;
}

/* Improve image rendering quality, especially for thumbnails */
img {
    image-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: #161803;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.subtitle {
    font-size: 1.1rem;
    color: #161803;
    font-weight: 300;
}

.demo-container {
    margin: 15px auto 0;
    max-width: 600px;
    background: #000000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    position: relative;
}

.demo-canvas {
    width: 100%;
    height: 300px;
    display: block;
}

.demo-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.demo-loading-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.demo-loading-message {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.instructions-toggle {
    max-width: 600px;
    margin: 15px auto;
    text-align: center;
}

.instructions-toggle summary {
    cursor: pointer;
    color: #820458;
    font-weight: 400;
    font-size: 0.95rem;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
    list-style: none;
    display: inline-block;
}

.instructions-toggle summary::-webkit-details-marker {
    display: none;
}

.instructions-toggle summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.2s ease;
}

.instructions-toggle[open] summary::before {
    transform: rotate(90deg);
}

.instructions-toggle summary:hover {
    background: #f9f9f9;
}

.instructions-toggle p {
    margin-top: 10px;
    color: #161803;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 300;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.upload-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.file-upload {
    margin-bottom: 15px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px dashed #989484;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 12px;
}

.file-label:hover {
    background: #f9f9f9;
    border-color: #398874;
}

.file-label.drag-over {
    background: #f9f9f9;
    border-color: #398874;
    transform: scale(1.02);
}

.file-label svg {
    color: #398874;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.file-label span {
    font-size: 0.95rem;
    color: #161803;
    font-weight: 300;
}

.preview-container {
    margin: 15px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-container img,
.preview-container canvas {
    max-width: 100%;
    max-height: 262px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin: 0 auto;
    cursor: pointer;
}

.preview-container canvas {
    transition: transform 0.2s ease;
}

.preview-container canvas:hover {
    transform: scale(1.02);
}

.zoom-hint {
    text-align: center;
    color: #989484;
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 300;
}

.preview-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
}

.options {
    margin: 15px 0;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.option-group {
    max-width: 300px;
    min-width: 200px;
    flex: 1;
    text-align: center;
}

.option-group label {
    display: block;
    font-weight: 400;
    color: #161803;
    margin-bottom: 8px;
    text-align: center;
}

.option-group select,
.option-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    text-align: center;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: #398874;
}

.option-group small {
    display: block;
    margin-top: 5px;
    color: #989484;
    font-size: 0.85rem;
    font-weight: 300;
    text-align: center;
}

.watermark-option {
    margin: 15px 0 10px;
    text-align: center;
}

.watermark-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #161803;
    font-weight: 300;
}

.watermark-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #398874;
}

.watermark-label span {
    user-select: none;
}

.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: #398874;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(57, 136, 116, 0.3);
    background: #2f6e5f;
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress-section {
    text-align: center;
    padding: 20px 0;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid #f0f0f0;
    border-top: 5px solid #398874;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#progressText {
    font-size: 1.1rem;
    color: #989484;
    font-weight: 300;
}

.result-section {
    text-align: center;
    padding: 20px 0;
}

.result-section h2 {
    color: #161803;
    margin-bottom: 0;
    font-weight: 400;
}

.result-preview {
    margin: 10px 0;
    padding: 10px;
    border-radius: 15px;
    display: inline-block;
}

.result-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: block;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.download-btn {
    padding: 14px 32px;
    background: #398874;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 400;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(57, 136, 116, 0.3);
    background: #2f6e5f;
}

.secondary-btn {
    padding: 14px 32px;
    background: white;
    color: #989484;
    border: 2px solid #989484;
    border-radius: 10px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: #989484;
    color: white;
    transform: translateY(-2px);
}

.error-section {
    text-align: center;
    padding: 20px;
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 10px;
    margin: 20px 0;
}

#errorText {
    color: #c53030;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    z-index: 20000;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

.zoom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-modal-content {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.zoom-modal-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.zoom-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.zoom-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.zoom-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.zoom-modal-content.grabbing {
    cursor: grabbing;
}

/* White mode scrollbars (for black background) */
.zoom-modal-content.white-mode::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

.zoom-modal-content.white-mode::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Black mode scrollbars (for white background) */
.zoom-modal-content.black-mode::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
}

.zoom-modal-content.black-mode::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.zoom-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.zoom-modal-image {
    display: block;
    max-width: 85vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    image-rendering: auto;
}

.zoom-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #398874;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #2f6e5f;
    transform: scale(1.1);
}

.zoom-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #161803;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 300;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.zoom-close:hover {
    background: #989484;
    color: white;
    transform: scale(1.1);
}

footer {
    margin-top: 20px;
    color: #989484;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 300;
}

.footer-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 24px;
    background: #820458;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 400;
    font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(130, 4, 88, 0.3);
    background: #6a0349;
}

.footer-legal {
    margin-top: 10px;
    font-size: 0.8rem;
}

.footer-legal a {
    color: #989484;
    text-decoration: none;
}

.footer-legal a:hover {
    color: #161803;
    text-decoration: underline;
}

.seo-content {
    background: #f9f9f9;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.seo-inner {
    max-width: 800px;
    margin: 0 auto;
}

.seo-content h2 {
    color: #161803;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 15px;
}

.seo-content h3 {
    color: #820458;
    font-size: 1.3rem;
    font-weight: 500;
    margin-top: 30px;
    margin-bottom: 12px;
}

.seo-content p {
    color: #161803;
    line-height: 1.7;
    margin-bottom: 15px;
    font-weight: 300;
}

.seo-content ol,
.seo-content ul {
    margin-left: 30px;
    margin-bottom: 20px;
}

.seo-content li {
    color: #161803;
    line-height: 1.7;
    margin-bottom: 10px;
    font-weight: 300;
}

.seo-content li strong {
    color: #161803;
    font-weight: 600;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .instructions-toggle summary {
        font-size: 0.9rem;
    }

    .instructions-toggle p {
        font-size: 0.85rem;
    }

    .upload-section {
        padding: 15px;
    }

    .options {
        flex-direction: column;
    }

    .result-actions {
        flex-direction: column;
    }

    .download-btn,
    .secondary-btn {
        width: 100%;
    }

    .seo-content {
        padding: 30px 15px;
    }

    .seo-content h2 {
        font-size: 1.5rem;
    }

    .seo-content h3 {
        font-size: 1.15rem;
        margin-top: 25px;
    }

    .seo-content ol,
    .seo-content ul {
        margin-left: 20px;
    }
}

/* T-shirt Order Modal */
.tshirt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.tshirt-modal-content {
    background: white;
    padding: 0;
    border-radius: 20px;
    max-width: 750px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tshirt-modal-content > * {
    padding-left: 20px;
    padding-right: 20px;
}

.tshirt-modal-content > :first-child {
    padding-top: 20px;
}

.tshirt-modal-scroll {
    overflow-y: auto;
    padding: 0 20px 20px 20px;
    flex: 1;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tshirt-close {
    position: absolute;
    top: 8px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #161803;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.tshirt-close:hover {
    background: #f0f0f0;
}

.tshirt-modal-content h2 {
    color: #161803;
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 10px;
    padding-top: 30px;
    text-align: center;
}

.tshirt-modal-content p {
    color: #666;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 400;
}

.tshirt-options {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.tshirt-region-btn {
    flex: 1;
    padding: 30px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #161803;
}

.tshirt-region-btn:not(:disabled):hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.tshirt-region-btn:not(:disabled):active {
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .tshirt-modal-content {
        padding: 30px 20px;
    }

    .tshirt-options {
        flex-direction: column;
    }

    .tshirt-region-btn {
        width: 100%;
    }
}
