:root {
    --primary-color: #007BFF;
    --primary-color-hover: #0056b3;
    --secondary-color: #4A5568;
    --secondary-color-hover: #2D3748;
    --background-color: #1A202C;
    --surface-color: #2D3748;
    --border-color: rgba(148, 163, 184, 0.2);
    --text-color: #E2E8F0;
    --text-muted: #A0AEC0;
    --shadow-color: rgba(0, 123, 255, 0.2);

    --watermark-size: 120px;
    --watermark-opacity: 0.1;
    --watermark-position-right: 10px;
    --watermark-position-bottom: 20px;
}

body,
html {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 14px;
}

a,
a:hover {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-select: none;
}

.container {
    min-height: 100vh;
    padding: 20px;
}

.editor-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 15px 20px;
    background-color: rgba(26, 32, 44, 0.7);
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.main-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
    flex: 1 1 0;
}

.draft-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* --- Editor --- */
.editor {
    padding: 20px;
}

.editor-main {
    flex: 1;
    min-width: 0;
}

#imageContainer {
    position: relative;
    max-width: 840px;
    height: 600px;
    background-color: #1A202C;
    overflow: hidden;
    margin-bottom: 10px;
    --watermark-image: url('../images/icao.png');
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* #imageContainer::after {
    content: '';
    position: absolute;
    right: var(--watermark-position-right);
    bottom: var(--watermark-position-bottom);
    background-image: var(--watermark-image);
    background-size: contain;
    background-repeat: no-repeat;
    opacity: var(--watermark-opacity);
    width: var(--watermark-size);
    height: var(--watermark-size);
    pointer-events: none;
} */

/* --- Bawah gmbr --- */
.bottom-controls-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.text-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.text-controls,
.watermark-controls {
    background-color: var(--background-color);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.watermark-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.font-size-control,
.shadow-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-weight: 500;
    color: var(--text-muted);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}


/* --- Tuwombol --- */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn i {
    font-size: 12px;
}

.btn.btn-primary {
    background-color: var(--primary-color);
    color: #FFFFFF;
}

.btn.btn-primary:hover {
    background-color: var(--primary-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn.btn-secondary,
.draft-controls .btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.draft-controls .btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn.btn-secondary:hover,
.draft-controls .btn:hover {
    background-color: var(--secondary-color-hover);
}

#draftList {
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E2E8F0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
}


/* --- Kontroler Gambar --- */
.toggle-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.image-controls {
    position: absolute;
    top: 60px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(26, 32, 44, 0.8);
    padding: 10px;
    border-radius: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid var(--border-color);
}

.image-controls.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

.zoom-controls,
.position-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.horizontal-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
}

/* --- Screen text --- */
.text-overlay {
    position: absolute;
    left: 40px;
    right: 40px;
    pointer-events: none;
    width: calc(100% - 80px);
}

#topText {
    top: 20px;
}

#bottomText {
    bottom: 20px;
}

.text-line-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 5px;
}

.text-overlay p {
    position: relative;
    display: block;
    width: 100%;
    white-space: nowrap;
    margin: 0 0 5px 0;
    padding: 0 5px;
    line-height: 0.8;
    font-family: Arial, sans-serif;
    font-weight: 700;
    color: #fff;
    box-sizing: border-box;
}

.text-overlay p.special {
    color: #c2a2da;
}

.text-overlay p.megaphone {
    color: #e1ff00;
}

.text-overlay p.putih {
    color: #ededed;
}

.text-overlay p.low {
    color: #7A4C76;
}

.overflow-notification {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    text-shadow: none;
}

.overflow-notification.visible {
    opacity: 1;
}


/* --- Mobile and friend --- */
@media (max-width: 1024px) {
    .bottom-controls-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .main-actions,
    .draft-controls {
        justify-content: center;
    }

    #imageContainer {
        height: 450px;
        max-width: 630px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .editor-wrapper {
        border-radius: 12px;
    }

    .editor {
        padding: 10px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    #imageContainer {
        height: 400px;
        max-width: 560%;
    }
}

/* --- footer --- */
.footer-container {
    padding: 20px 0;
    font-family: 'Poppins', sans-serif;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.copyright {
    color: #888;
    font-size: 14px;
}

.watermark-settings {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    /* jarak antar div setting, bisa diubah sesuai selera */
}

.watermark-setting {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* jarak antar label, input, dan value dalam satu setting */
}

.watermark-settings label {
    margin-bottom: 2px;
}

.watermark-settings input[type="range"] {
    width: 100%;
}

.watermark-position {
    display: flex;
    gap: 4px;
}

.watermark-position button {
    padding: 2px 8px;
    font-size: 1em;
    border: 1px solid #bbb;
    background: #f8f8f8;
    cursor: pointer;
    border-radius: 3px;
}

.watermark-position button.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--surface-color, #23272f);
    color: var(--text-color, #fff);
    padding: 24px 20px 18px 20px;
    border-radius: 10px;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
    position: relative;
    text-align: center;
}

.close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 1.5em;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #fff;
}

#uploadedLink {
    background: #181c22;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 1em;
}

#copyUploadLink {
    margin-top: 4px;
}