/* ==========================================================================
   TWIBBON STYLES (css/twibbon.css)
   VERSI PRO: LINEAR 1400px & PRECISION EDITOR
   ========================================================================== */

   .twibbon-page {
    background-color: #fcfcfd;
    min-height: 100vh;
    padding-bottom: 100px;
    width: 100%;
    box-sizing: border-box;
}

/* --- SOLUSI ANTI KETUTUP NAVBAR --- */
.navbar-spacer {
    height: 120px;
    width: 100%;
}

/* --- CONTAINER LINEAR (KUNCI 1400px) --- */
.twibbon-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    box-sizing: border-box;
}

/* Header Section */
.page-title-wrapper {
    text-align: center;
    margin-bottom: 60px;
}

.badge-herai {
    display: inline-block;
    background: var(--light-pink);
    color: var(--primary-pink);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.page-title-wrapper h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--dark-purple);
    letter-spacing: -2px;
}

.page-title-wrapper h1 span {
    color: var(--primary-pink);
}

.slogan {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-top: 10px;
    font-weight: 500;
}

/* --- EDITOR GRID LAYOUT --- */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Preview Kiri, Aksi Kanan */
    gap: 60px;
    align-items: start;
}

/* --- PREVIEW COLUMN --- */
.preview-column {
    position: sticky;
    top: 140px;
}

.canvas-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 32px;
    border: 2px dashed var(--gray-medium);
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(11, 20, 55, 0.08);
}

.upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    z-index: 5;
}

.placeholder-content i {
    font-size: 4rem;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.placeholder-content p {
    color: var(--text-muted);
    font-weight: 600;
}

.hint {
    font-size: 0.8rem;
    color: #ccc;
    display: block;
    margin-top: 10px;
}

/* Twibbon Editor Core */
.twibbon-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
}

#userPhoto {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 1;
    cursor: move;
    max-width: none;
    transition: filter 0.3s ease;
}

.png-twibbon-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* KRUSIAL: Agar mouse bisa 'tembus' ke foto di bawahnya */
    pointer-events: none; 
    user-select: none;
}

/* Photo Controls */
.photo-controls {
    margin-top: 30px;
    background: var(--dark-purple);
    padding: 20px 30px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.btn-control {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-control:hover {
    background: var(--primary-pink);
    transform: scale(1.1);
}

.btn-reset {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-weight: 600;
    width: auto;
    padding: 0 20px;
}

input[type="range"] {
    flex-grow: 1;
    accent-color: var(--primary-pink);
    height: 6px;
    border-radius: 10px;
}

/* --- ACTION COLUMN --- */
.action-card {
    background: #fff;
    padding: 40px;
    border-radius: 28px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.action-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-purple);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.step-num {
    background: var(--primary-pink);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
}

.btn-upload {
    display: block;
    width: 100%;
    padding: 20px;
    background: var(--light-pink);
    color: var(--primary-pink);
    border: 2px dashed var(--primary-pink);
    border-radius: 18px;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-upload:hover {
    background: var(--primary-pink);
    color: #fff;
}

.desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 18px 20px 18px 50px;
    border-radius: 15px;
    border: 1px solid var(--gray-medium);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-pink);
}

.btn-download {
    width: 100%;
    padding: 20px;
    background: var(--primary-pink);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.4s;
    box-shadow: 0 10px 25px rgba(255, 20, 147, 0.2);
}

.btn-download:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
}

/* --- CAPTION BOX --- */
.caption-box {
    margin-top: 10px;
}

#captionText {
    width: 100%;
    height: 180px;
    padding: 20px;
    border-radius: 18px;
    background: #f9fafb;
    border: 1px solid var(--gray-medium);
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    margin-bottom: 15px;
    /* AGAR BISA DICOPY MESKIPUN ADA PROTEKSI GLOBAL */
    user-select: text !important;
    -webkit-user-select: text !important;
}

.btn-copy {
    width: 100%;
    padding: 15px;
    background: var(--dark-purple);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-copy:hover {
    background: var(--primary-pink);
}

/* --- MAGIC OVERLAY --- */
.magic-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 20, 55, 0.98);
    z-index: 9999;
    display: none; /* Control via JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.magic-overlay.active {
    display: flex;
}

.magic-wand i {
    font-size: 4rem;
    color: var(--primary-pink);
    margin-bottom: 30px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.magic-progress {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 30px;
    overflow: hidden;
}

.magic-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-pink);
    transition: width 0.4s ease;
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
    .editor-grid { gap: 30px; }
    .page-title-wrapper h1 { font-size: 2.5rem; }
}

@media (max-width: 992px) {
    .editor-grid { grid-template-columns: 1fr; }
    .preview-column { position: static; }
    .canvas-wrapper { max-width: 500px; margin: 0 auto; }
    .photo-controls { max-width: 500px; margin: 25px auto 0; }
}

@media (max-width: 768px) {
    .twibbon-page .container { padding: 0 20px; }
    .page-title-wrapper h1 { font-size: 1.8rem; }
    .action-card { padding: 30px; }
    .navbar-spacer { height: 90px; }
}