/* === Chrome, Edge, Safari === */
::-webkit-scrollbar {
  width: 10px;              /* lebar scrollbar */
}

::-webkit-scrollbar-track {
  background: #1e1e1e;      /* background track */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #555;         /* warna scroll handle */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #888;         /* hover efek */
}

/* === Firefox === */
* {
  scrollbar-width: thin;             /* "auto" | "thin" */
  scrollbar-color: #555 #1e1e1e;     /* thumb | track */
}

/* RESET BASIC */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* BODY & BACKGROUND */
body {
    background-color: #1e1e1e;
    color: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* MAIN TEXT */
.maintext{
    pointer-events: none;
}

/* TOPBAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c2c2c;
    padding: 10px 20px;
    /* border-bottom: 1px solid #444; */
}


.topbar .logo {
    width: 60px;
    height: auto;
    /* background-color: #fff; */
}

.topbar-button-container {
    /* background-color: #03dac6; */
    display: flex;
    width: auto;
    justify-content: center;
    align-items: center; 
    gap: 15px;
}

.ai-api, .about {
    background: none;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

/* MAIN CONTAINER */
.main-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

/* SECTION COLUMN */
.section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 240px;
}

.section-button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 240px;
    max-height: 83vh; 
    overflow-y: auto;
}

.section .maintext {
    font-weight: bold;
    /* margin-bottom: 10px; */
    color: #fff;
    text-decoration: none;
}

.section-button {
    background-color: #2c2c2c;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
    font-weight: 400;
    cursor: pointer;
    margin-right: 4%;
    transition: background 0.2s;

    text-align: left;
}

.section-button:hover {
    background-color: #3a3a3a;
}

/* TEXT FORMATTING */
.top-bar-formating {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-formating {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.text-formating .maintext {
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.button-container button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.4em 1.1em;
  font-size: 0.65em;
  font-weight: 500;

  border: none;
  border-radius: 0.5em;

  background-color: #2d2d2d;
  color: #fff;

  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.button-container button:hover {
  background-color: #3a3a3a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.button-container button:active {
  transform: scale(0.96);
  background-color: #1f1f1f;
}


/* PREVIEW COLUMN */
.preview {
    display: flex;
    flex-direction: column;
    width: 40%;
    gap: 10px;
}

.top-bar-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-preview .maintext {
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.preview-box {
    background-color: #2c2c2c;
    flex: 1;
    border-radius: 8px;
}

/* DOWNLOAD BUTTON */
.download-button, .copy-button {
  width: 1.4em;
  height: 1.4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;
  border-radius: 0.25em;

  cursor: pointer;
  padding: 0; /* biar gak nambah ukuran */
  color: #333; /* warna icon */
  transition: background 0.2s, transform 0.15s;
}

.download-button, .copy-button:hover {
  background: rgba(0,0,0,0.1);
}

.download-button, .copy-button:active {
  transform: scale(0.9);
}

.preview-button-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between; 
  align-items: center;            
  gap: 8px;                      
  width: auto;                  
  box-sizing: border-box;        
}

.download{
    width: auto; 
    height: auto;
    vertical-align: middle;
    fill: #fff;
    overflow: hidden;
}

.copy{
    width: auto; 
    height: auto;
    vertical-align: middle;
    fill: transparent;
    overflow: hidden;
}

/* TAB DESIGN */
.tab-container {
    display: flex;
    flex-wrap: wrap;
    /* max-width: 600px; */
    /* margin: 50px auto; */
    height: calc(100vh - 120px);
    height: 100%;
    background-color: #2a2a2a;
    padding: 10px;
    border-radius: 8px;
}

.tab-container input[type="radio"] {
    display: none;
}

.tab-container label {
    padding: 6px 14px; 
    background-color: #2d2d2d;
    /* border-top-left-radius: 6px;
    border-top-right-radius: 6px; */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #c5c5c5;
    transition: all 0.2s ease;
}

label:hover {
    background-color: #3c3c3c;
}

.tab-container label[contenteditable="true"] {
  outline: none;          
  border: none;            
  background: inherit;    
  color: inherit;          
  font-family: inherit;    
  font-size: inherit;     
  line-height: inherit;   
  padding: 0;              
  margin: 0;              
  caret-color: transparent;    
  box-shadow: 0 -2px 0 0 #03dac6; 
}

.tab-container .tab {
    width: 100%;
    background: #fff;
    order: 1;
    display: none;
    display: none;
    /* padding: 15px; */
    background-color: #2c2c2c;
    border-radius: 0 6px 6px 6px;
    margin-top: -1px;
    height: auto;
    box-sizing: border-box;
    flex-direction: column;
}

.tab-container input[type='radio']:checked + label + .tab {
    display: block;
}

/* Active tab */
.tab-container input[type="radio"]:checked + label {
    background-color: #1e1e1e; 
    color: #fff;
    box-shadow: 0 -2px 0 0 #03dac6; 
}

.editor {
  width: 100%;
  height: calc(100vh - 310px);;
  background-color: #2c2c2c;
  color: #fff;
  font-size: 14px;
  outline: none;
  overflow: hidden;
  box-sizing: border-box;
}


/* PREVIEW BOX */
.preview-box{
    padding: 2%;
}

#md-content{
    width: 100%;
    height: 100%;
    background-color: #FFF;
    padding: 2%;
    color: #000;
    overflow-y: visible;
}

/* TOAST ALERT */
.toast {
    visibility: hidden;
    min-width: 180px; 
    max-width: 300px;
    background-color: rgba(30, 30, 30, 0.95);
    color: #eee;
    text-align: center;
    border-radius: 16px;
    padding: 14px 22px;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 1rem;
    backdrop-filter: blur(6px);
}


/* Show Toast */
.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0); 
}

.toast.hide {
    opacity: 0;
    transform: translateY(50px); /* turun lagi */
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Optional: Different Types of Toasts */
.toast.success { background-color: #28a745; }
.toast.error   { background-color: #dc3545; }
.toast.info    { background-color: #17a2b8; }
.toast.warning { background-color: #ffc107; color: #000; }

/* POP UP */

/* Background overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* Popup box */
.popup {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.overlay.active .popup {
    transform: scale(1);
}

.popup h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.popup input{
    width: 100%;
    height: 45px;
    background: #2a2a2a;
    border: none;
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    resize: none;
    margin-bottom: 15px;
    font-size: 14px;
}

.popup a {
    color: #2563eb; 
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.popup p {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
}

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.popup button {
    background: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.popup button:hover {
    background: #444;
}

.popup button.confirm {
    background: #444;
}

.popup button.confirm:hover {
    background: #555;
}


/* === AI PROMPT SECTION === */
.ai-prompt {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 10px;
    background: #2c2c2c;
    border-radius: 8px;
}

.top-bar-ai-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-ai-prompt button{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.4em 1.1em;
    font-size: 0.65em;
    font-weight: 500;

    border: none;
    border-radius: 0.5em;

    background-color: #262626;
    color: #fff;

    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.ai-prompt p {
    font-size: 0.85rem;
    font-weight: 500;
    color: #eee;
    margin: 0;
}

.ai-prompt-box {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    font-size: 0.85rem;

    border: none;
    border-radius: 6px;
    background-color: #1e1e1e;
    color: #f0f0f0;

    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.ai-prompt-box:focus {
    border-color: #4c9aff; /* biru accent */
}

