/* ==========================================================================
   1. GLOBAL RESET & BOX-SIZING
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; 
}

:root {
    --primary: #fe2c55; 
    --dark: #121212;
    --gray: #2f2f2f;
    --text: #ffffff;
}

html {
    -webkit-text-size-adjust: 100%; 
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark);
    color: var(--text);
    padding: 20px 12px; 
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    min-height: 100vh;
}

/* ==========================================================================
   2. APP WRAPPER & LAYOUT UTAMA (DESKTOP WIDE)
   ========================================================================== */
.app-wrapper {
    width: 100%;
    max-width: 1050px; /* Diperlebar agar muat 2 kolom berdampingan dengan lega */
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #1e1e1e;
    border: 1px solid #2f2f2f;
    border-radius: 12px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.container {
    width: 100%;
    background: #1e1e1e;
    padding: 25px; 
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Kunci utama pembagian 2 Kolom di Desktop */
.workspace-layout {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Membagi kiri dan kanan sama rata (50% : 50%) */
    gap: 25px; /* Jarak ruang di antara kedua kolom */
    margin-top: 15px;
    align-items: start;
}

.workspace-col {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   3. KOMPONEN INDIVIDUAL & ELEMEN FORM
   ========================================================================== */
.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.5px;
}

.header-logo svg {
    width: 22px;
    height: 22px;
    color: #ff9800;
}

h2 { 
    margin: 0; 
    color: var(--primary); 
    font-size: 24px;
}

.vortex-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    animation: spin 4s linear infinite;
}

.auth-box, .quota-box {
    background: var(--gray);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

textarea {
    width: 100%;
    height: 260px; /* Dipertinggi sedikit agar seimbang dengan layar desktop yang luas */
    background: #2a2a2a;
    border: 1px solid #444;
    color: white;
    padding: 14px;
    border-radius: 8px;
    resize: vertical;
    font-size: 16px; 
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.output-box {
    background: #151515;
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    position: relative;
    min-height: 260px; /* Disamakan dengan tinggi textarea agar simetris kiri-kanan */
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#outputText {
    user-select: text !important;
    -webkit-user-select: text !important; 
    -moz-user-select: text !important;   
    -ms-user-select: text !important;    
    white-space: pre-wrap; 
    word-wrap: break-word;
    flex-grow: 1;
}

/* BUTTONS STYLE */
.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 16px; 
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-top: 5px;
    font-size: 15px;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-google { background-color: #4285F4; margin-bottom: 10px; }
.btn-pro { background-color: #ff9800; }
.btn-success { background-color: #4CAF50; margin-top: 15px;}

.avatar-trigger-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
}

#nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ff9800;
    object-fit: cover;
}

/* ==========================================================================
   4. MODALS & OVERLAYS (PROFIL, QRIS, IKLAN INTERSTITIAL)
   ========================================================================== */
.profile-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-modal-card {
    background: #16161a;
    border: 1px solid #24242b;
    color: #ffffff;
    padding: 30px 25px;
    border-radius: 18px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.profile-close-btn {
    position: absolute;
    top: 12px; right: 18px;
    font-size: 26px;
    cursor: pointer;
    color: #71717a;
}
.profile-close-btn:hover { color: #ffffff; }

.profile-detail-box { margin: 15px 0 20px 0; }

#profile-avatar {
    width: 76px; height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ff9800;
    margin-bottom: 12px;
}

#profile-name { font-size: 16px; font-weight: 600; }
#profile-email { font-size: 13px; color: #8a8a93; margin: 4px 0 12px 0; word-break: break-all; }

.badge-status {
    display: inline-block;
    padding: 4px 12px;
    background: #27272a;
    color: #d4d4d8;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
}
.badge-status.badge-pro {
    background: linear-gradient(135deg, #ff9800, #e65100);
    color: #ffffff;
}

.btn-signout-action {
    width: 100%;
    padding: 11px;
    background: #ff4d4d;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px; 
}

.modal-content {
    background: #222;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    width: 340px;
}

/* ANIMATIONS & SPINNERS */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   5. RESPONSIVE OPTIMIZATION (MOBILE VIEW - OTOMATIS VERTIKAL)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 10px 6px; 
    }

    .main-header {
        border-radius: 8px;
        padding: 10px 14px;
    }

    .container {
        padding: 16px; 
        border-radius: 8px;
    }

    /* Kembalikan workspace menjadi 1 kolom bertumpuk ke bawah di HP */
    .workspace-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    h2 {
        font-size: 20px; 
    }

    textarea {
        height: 140px; 
    }

    .output-box {
        min-height: 100px;
    }
}