* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #2b0057, #05000f 70%);
    color: white;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 25px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 40px;
}

.logo span {
    color: #00eaff;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu {
    width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    color: white;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s ease;
}

.menu:hover,
.menu.active {
    background: linear-gradient(90deg, #7b2cff, #00eaff);
}

/* MAIN AREA */
.main {
    flex: 1;
    padding: 35px;
}

header h1 {
    margin: 0;
    font-size: 34px;
}

header p {
    opacity: 0.7;
    margin-bottom: 25px;
}

/* ==========================================
   BARIS KONTROL UTAMA (DRAWER + GENERATE SEJAJAR)
   ========================================== */
.action-control-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Laci / Drawer Akun Utama */
.account-panel.drawer {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    width: 280px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 46px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.drawer-header:hover {
    background: rgba(0, 234, 255, 0.12);
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #00eaff;
    font-size: 14px;
}

.drawer-arrow {
    color: #00eaff;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.drawer-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 16px;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

.account-panel.drawer.open .drawer-content {
    max-height: 800px;
    opacity: 1;
    padding: 15px 16px 16px 16px;
}

.account-panel.drawer.open .drawer-arrow {
    transform: rotate(180deg);
}

.panel-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-item {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 13px;
}

.account-item:hover {
    background: rgba(0, 234, 255, 0.15);
}

.account-item.active {
    border: 1px solid #00eaff;
}

.account-profile {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

.account-profile h3 {
    margin: 0 0 8px 0;
    color: #7b2cff;
    font-size: 12px;
}

.account-profile p {
    margin: 6px 0 2px 0;
    font-size: 11px;
    opacity: 0.7;
}

.account-profile span {
    display: block;
    font-size: 12px;
    line-height: 1.4;
}

.account-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.account-actions button {
    flex: 1;
    padding: 8px 4px;
    font-size: 11px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(90deg, #7b2cff, #00eaff);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* Tombol Generate (Tinggi Sama Dengan Header Drawer) */
.btn-generate-main {
    height: 46px;
    width: auto;
    white-space: nowrap;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #7928ca, #00dfd8);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 223, 216, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-self: flex-start;
}

.btn-generate-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 223, 216, 0.5);
}

/* RESULT DISPLAY MEDIA OS */
.card {
    padding: 25px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    box-shadow: 0 0 25px rgba(123, 44, 255, 0.15);
}

.card h2 {
    margin-top: 0;
    color: #00eaff;
    font-size: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

#output {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    padding-top: 10px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-box {
    position: relative;
    width: 350px;
    padding: 25px;
    border-radius: 20px;
    background: linear-gradient(145deg, #12002b, #05000f);
    box-shadow: 0 0 30px rgba(0, 234, 255, 0.4);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: auto;
    padding: 0;
}

.modal-box h3 {
    margin-top: 0;
    color: #00eaff;
}

.modal-box label {
    display: block;
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.modal-box input,
.modal-box textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
}

.modal-box textarea {
    height: 80px;
    resize: none;
}

.modal-box button#saveNewAccount {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(90deg, #7b2cff, #00eaff);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .action-control-row {
        flex-direction: column;
        align-items: stretch;
    }
    .account-panel.drawer {
        width: 100%;
    }
    .btn-generate-main {
        width: 100%;
    }
}

/* ==========================================
   MEDIA OS ACCORDION LIST & DRAWER STYLE
   ========================================== */

.media-os-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.media-os-item {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(0, 234, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.media-os-item:hover {
    border-color: rgba(0, 234, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 234, 255, 0.2);
}

.media-os-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.media-os-header:hover {
    background: rgba(0, 234, 255, 0.08);
}

.media-os-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    flex: 1;
    padding-right: 15px;
}

.media-os-badge {
    background: rgba(0, 234, 255, 0.15);
    color: #00eaff;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid rgba(0, 234, 255, 0.3);
    white-space: nowrap;
}

.media-os-title {
    color: #e2e8f0;
    line-height: 1.4;
}

.media-os-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tombol Salin */
.btn-copy {
    background: rgba(123, 44, 255, 0.25);
    border: 1px solid rgba(123, 44, 255, 0.6);
    color: #d8b4fe;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(123, 44, 255, 0.6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(123, 44, 255, 0.4);
}

.btn-copy.copied {
    background: #00eaff !important;
    color: #05000f !important;
    border-color: #00eaff !important;
}

.media-os-arrow {
    color: #00eaff;
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* Laci / Content Body */
.media-os-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    padding: 0 18px;
}

.media-os-item.open .media-os-body {
    max-height: 800px;
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.media-os-item.open .media-os-arrow {
    transform: rotate(180deg);
}

.media-os-body-content {
    font-size: 13px;
    line-height: 1.8;
    color: #cbd5e1;
}

.media-os-body-content strong {
    color: #00eaff;
}

/* Loading Spinner */
.loading-state {
    padding: 20px;
    text-align: center;
    color: #00eaff;
    font-weight: bold;
}

.spinner {
    display: inline-block;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   MEDIA OS ACCORDION DRAWER LIST
   ========================================== */

.media-os-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.media-os-item {
    background: rgba(18, 18, 37, 0.8);
    border: 1px solid rgba(0, 234, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease-in-out;
}

.media-os-item:hover {
    border-color: rgba(0, 234, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 234, 255, 0.15);
}

/* Header Laci (Hanya Judul & Badge) */
.media-os-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    user-select: none;
}

.media-os-header:hover {
    background: rgba(0, 234, 255, 0.06);
}

.media-os-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    padding-right: 15px;
}

.media-os-badge {
    background: rgba(0, 234, 255, 0.15);
    color: #00eaff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid rgba(0, 234, 255, 0.3);
}

.media-os-title {
    color: #ffffff;
    line-height: 1.4;
}

.media-os-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tombol Salin */
.btn-copy {
    background: rgba(123, 44, 255, 0.25);
    border: 1px solid rgba(123, 44, 255, 0.6);
    color: #d8b4fe;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(123, 44, 255, 0.6);
    color: #ffffff;
}

.btn-copy.copied {
    background: #00eaff !important;
    color: #05000f !important;
    border-color: #00eaff !important;
}

.media-os-arrow {
    color: #00eaff;
    font-size: 11px;
    transition: transform 0.3s ease;
}

/* Isi Laci yang Tersembunyi (Collapsed by Default) */
.media-os-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    padding: 0 18px;
}

/* Ketiia Laci Terbuka */
.media-os-item.open .media-os-body {
    max-height: 1000px;
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: max-height 0.5s ease-in-out, padding 0.3s ease;
}

.media-os-item.open .media-os-arrow {
    transform: rotate(180deg);
}

.media-os-body-content {
    font-size: 13px;
    line-height: 1.8;
    color: #cbd5e1;
}

.media-os-body-content strong {
    color: #00eaff;
}