/* ==========================================================
   ADRIANA 55300 • BRAIDE 55 • JOEL 5522
   Clean Modern Design & Light-Theme Profile Photo Editor
   ========================================================== */

:root {
    --theme-blue: #0030B5;
    --theme-blue-hover: #002693;
    --theme-blue-light: #eff2ff;
    --btn-bg-light: #eeeeed;
    --btn-text-dark: #1e293b;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --bg-white: #ffffff;
    --bg-surface: #f8fafc;
    --border-light: #e2e8f0;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-modal: 22px;
    --radius-btn: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #0030B5;
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* ==========================================================
   MAIN APP VIEWPORT (Matches Mobile & Mockup Reference)
   ========================================================== */
.app-viewport {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #0030B5;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
}

/* --- TOP HEADER --- */
.app-header {
    width: 100%;
    background-color: #0030B5;
    position: relative;
    z-index: 10;
}

.header-banner-wrap {
    width: 100%;
    display: block;
    line-height: 0;
    background-color: #0030B5;
}

.header-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* --- CENTER VIDEO CONTAINER (9:16 Vertical Video) --- */
.video-container {
    flex: 1;
    width: 100%;
    background-color: #0030B5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0030B5;
}

.reel-video {
    width: 100%;
    height: 100%;
    max-height: 75vh;
    object-fit: contain;
    background-color: #0030B5;
    display: block;
    cursor: pointer;
}

/* Play/Pause Overlay */
.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: opacity 0.25s ease;
    z-index: 5;
}

.video-play-overlay.is-playing {
    opacity: 0;
    pointer-events: none;
}

.center-play-btn {
    width: 70px;
    height: 70px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-size: 1.7rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding-left: 4px;
    transition: transform 0.2s ease;
}

.center-play-btn:hover {
    transform: scale(1.08);
}

/* Floating Controls */
.video-controls-bar {
    position: absolute;
    right: 14px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.ctrl-btn {
    width: 38px;
    height: 38px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: var(--theme-blue);
    transform: scale(1.08);
}

/* Progress Bar */
.video-progress-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 10;
}

.video-progress-fill {
    width: 0%;
    height: 100%;
    background: #00d2ff;
    transition: width 0.1s linear;
}

/* --- BOTTOM FOOTER ("Foto de perfil" Button) --- */
.app-footer {
    width: 100%;
    background-color: var(--theme-blue);
    padding: 18px 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.btn-profile-photo {
    width: 100%;
    background-color: var(--btn-bg-light);
    color: var(--btn-text-dark);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    padding: 15px 20px;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    letter-spacing: -0.3px;
}

.btn-profile-photo:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.btn-profile-photo:active {
    transform: scale(0.98);
}

/* ==========================================================
   CLEAN LIGHT THEME MODAL (Foto de Perfil 1080x1080)
   ========================================================== */
.editor-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.editor-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.editor-card {
    background: var(--bg-white);
    border-radius: var(--radius-modal);
    width: 100%;
    max-width: 460px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-modal.active .editor-card {
    transform: translateY(0) scale(1);
}

/* Modal Header Clean */
.modal-header-clean {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
}

.header-title-clean {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title-clean i {
    color: var(--theme-blue);
    font-size: 1.2rem;
}

.header-title-clean h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.btn-modal-close {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.btn-modal-close:hover {
    background: #e2e8f0;
    color: var(--text-dark);
}

/* Modal Body */
.modal-body-clean {
    padding: 18px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
}

/* Frame Selector Pills */
.frame-selector-clean {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-clean {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pill-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg-surface);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.pill-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s ease;
}

.pill-btn strong {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 700;
}

.pill-btn small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.pill-btn.active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pill-btn.active strong {
    color: var(--theme-blue);
}

/* Canvas Box */
.canvas-clean-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.canvas-clean-box {
    position: relative;
    width: 100%;
    max-width: 310px;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #f1f5f9;
    border: 2px solid var(--border-light);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    touch-action: none;
    cursor: grab;
}

.canvas-clean-box:active {
    cursor: grabbing;
}

#photo-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Circular Mask Overlay */
.circle-mask-clean {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.circle-mask-clean.visible {
    opacity: 1;
}

/* Upload Dropzone (Empty State) */
.upload-dropzone-clean {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    z-index: 15;
    transition: background 0.2s ease;
}

.upload-dropzone-clean:hover {
    background: #edf2f7;
}

.dropzone-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--theme-blue-light);
    color: var(--theme-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.upload-dropzone-clean h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.upload-dropzone-clean p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.btn-upload-pill {
    background: var(--theme-blue);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(62, 81, 250, 0.3);
}

/* Controls Panel */
.controls-clean-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zoom-clean-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-surface);
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.zoom-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.slider-clean-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.btn-step-clean {
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-step-clean:hover {
    background: var(--theme-blue);
    color: #fff;
    border-color: var(--theme-blue);
}

input[type="range"] {
    flex: 1;
    height: 6px;
    background: #cbd5e1;
    border-radius: 4px;
    outline: none;
    accent-color: var(--theme-blue);
    cursor: pointer;
}

/* Quick Tools Grid */
.tools-clean-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tool-clean-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-dark);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool-clean-btn i {
    font-size: 0.95rem;
    color: var(--theme-blue);
}

.tool-clean-btn:hover {
    background: var(--theme-blue-light);
    border-color: var(--theme-blue);
}

.tool-clean-btn.active {
    background: var(--theme-blue);
    border-color: var(--theme-blue);
    color: #ffffff;
}

.tool-clean-btn.active i {
    color: #ffffff;
}

.btn-trocar-foto i {
    color: #f59e0b;
}

.drag-info-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4px;
}

/* Modal Footer Actions */
.modal-footer-clean {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 22px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border-light);
}

.btn-download-clean {
    background: var(--theme-blue);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(62, 81, 250, 0.3);
    transition: all 0.2s ease;
}

.btn-download-clean:not(:disabled):hover {
    background: var(--theme-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(62, 81, 250, 0.4);
}

.btn-download-clean:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-whatsapp-clean {
    background: #25D366;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-whatsapp-clean:not(:disabled):hover {
    background: #1eb956;
    transform: translateY(-1px);
}

.btn-whatsapp-clean:disabled {
    background: #dcfce7;
    color: #86efac;
    cursor: not-allowed;
}

/* Toast Message */
.toast-clean {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e293b;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 22px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-clean.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .app-viewport {
        box-shadow: none;
    }
    
    .editor-card {
        max-height: 96vh;
        border-radius: 18px;
    }
    
    .modal-body-clean {
        padding: 14px 16px;
    }

    .modal-header-clean,
    .modal-footer-clean {
        padding: 14px 16px;
    }
}
