body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    min-height: 100vh;
    color: #2d3436;
    overflow-x: hidden;
}

.container {
    width: 95%;
    max-width: 1400px;
    min-height: 85vh;
    text-align: center;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: width 0.3s ease;
    position: relative;
}

h1 {
    font-weight: 800;
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    line-height: 1.2;
}

h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

h1 a:hover {
    opacity: 0.9;
}

.make-own-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 40px;
    border-radius: 100px;
    margin-top: 20px;
    display: inline-block;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
    text-shadow: none;
}

.make-own-link:hover {
    background: #ffffff;
    color: #6c5ce7;
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: #ffffff;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.upload-section {
    margin-bottom: 2rem;
    padding: 4rem 2rem;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    cursor: pointer;
}

.upload-section.drag-over {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.upload-section:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.upload-icon {
    font-size: 4rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    display: block;
}

/* Prevent flash on shared links */
.is-shared-view .upload-icon,
.is-shared-view .upload-btn {
    display: none !important;
}

#pdf-upload {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: #ffffff;
    color: #6c5ce7;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.upload-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

#file-name {
    margin-top: 1.5rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 0 2px 15px rgba(0,0,0,0.3);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* Custom Draggable Flower */
.zoom-controls {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 75px;
    right: 25px;
    left: auto;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: move;
    user-select: none;
    touch-action: none;
    color: #ff7eb3; /* Flower color */
}

@media (max-width: 768px) {
    .zoom-controls {
        right: 20px;
        bottom: 100px;
    }
}

.zoom-controls.dragging {
    transition: none !important;
    cursor: grabbing;
}

.zoom-controls.active {
    display: flex;
}

/* Removed hover effects */

.flower-icon {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* Only show and give height when it has content and is ready */
#flipbook-container:not(:empty).ready {
    min-height: 70vh;
    display: block;
    opacity: 1;
}

#flipbook-container {
    margin-top: 2rem;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.df-container {
    background: #f0f0f0 !important;
}

#flipbook-container:empty {
    display: none;
}

/* Hide DearFlip loading wheel and info */
.df-container:before, 
.df-container:after,
.df-container .loading-info {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(25, 25, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3.5rem 2.5rem;
    border-radius: 32px;
    width: 90%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content h3 {
    margin: 0 0 0.75rem 0;
    font-size: 2rem;
    color: white;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-content p {
    margin: 0 0 2.5rem 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    line-height: 1.5;
}

#flipbook-name-input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.2s;
}

#flipbook-name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#flipbook-name-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-buttons button {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #6c5ce7;
    color: white;
}

.btn-primary:hover {
    background: #5b4bc4;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f2f6;
    color: #2d3436;
}

.btn-secondary:hover {
    background: #dfe4ea;
}

/* Share Modal Styles */
.share-link-container {
    display: flex;
    gap: 0;
    margin: 15px 0 30px 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.share-label {
    text-align: left;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#share-link-input,
#embed-code-input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: white;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    width: 100%;
}

.btn-copy {
    background: #ffffff;
    color: #6c5ce7;
    border: none;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #f8f9fa;
    transform: scale(1.02);
}

.share-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 35px;
    justify-content: center;
}

.btn-share {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
}

.btn-share:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-share svg {
    width: 28px;
    height: 28px;
}

.btn-whatsapp svg { color: #25D366; }
.btn-whatsapp-biz svg { color: #128C7E; }
.btn-messenger svg { color: #0084FF; }

#share-modal-close {
    border-radius: 99px !important;
    width: auto !important;
    min-width: 140px !important;
    height: 54px !important;
    padding: 0 30px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: white !important;
    color: #6c5ce7 !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
}

#share-modal-close:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3) !important;
}

.creator-credit {
    margin-top: auto;
    padding-top: 40px;
    padding-bottom: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.creator-credit a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
}

.creator-credit a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Embed Mode */
body.is-embedded {
    background: #f0f0f0;
    padding: 0;
    margin: 0;
    display: block;
}

.is-embedded .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.is-embedded h1,
.is-embedded .subtitle,
.is-embedded .creator-credit,
.is-embedded .zoom-controls,
.is-embedded .make-own-link {
    display: none !important;
}

.is-embedded #flipbook-container {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
}

.is-embedded #file-name {
    color: #2d3436;
    font-size: 1.5rem;
    padding-top: 20px;
}