:root {
    --sec-dark: #065f46;
    --sec-main: #059669;
    --sec-pale: #ecfdf5;
    --border-sec: #6ee7b7;
    --bg-light: #F8F9FA;
}

body {
    background-color: var(--bg-light);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.custom-header {
    background: linear-gradient(135deg, var(--sec-dark), var(--sec-main));
    color: white;
    padding: 24px 0;
}
.custom-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.custom-header p {
    opacity: 0.9;
    margin-bottom: 0;
    font-size: 0.9rem;
}
.header-menu-link {
    opacity: 0.9;
    font-size: 0.9rem;
}
.header-menu-link:hover {
    opacity: 1;
}

/* Main Layout */
.main-flex-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 24px;
    padding: 24px;
}

/* Sidebar */
.sidebar-menu {
    width: 260px;
    flex-shrink: 0;
}
.sidebar-info {
    background: var(--sec-pale);
    border: 1px solid var(--border-sec);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.8rem;
    color: var(--sec-dark);
    margin-top: 16px;
    line-height: 1.6;
}

/* Sidebar Menu Items (dihasilkan oleh sidebar-menu.js -- struktur:
   <a class="menu-item [active]"><span class="menu-item-icon">..</span><span>..</span></a> ) */
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background-color 0.12s, color 0.12s;
}
.menu-item:hover {
    background-color: var(--sec-pale);
    color: var(--sec-dark);
    text-decoration: none;
}
.menu-item.active {
    background-color: var(--sec-pale);
    color: var(--sec-dark);
    font-weight: 700;
}
.menu-item-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Work Area */
.work-area {
    flex: 1;
    min-width: 0;
}
.tool-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.tool-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tool-title i {
    color: var(--sec-main);
}

/* Form Controls */
.form-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--sec-main);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.form-range::-webkit-slider-thumb {
    background-color: var(--sec-main);
}
.form-range::-moz-range-thumb {
    background-color: var(--sec-main);
}
.form-check-input:checked {
    background-color: var(--sec-main);
    border-color: var(--sec-main);
}

.control-row {
    margin-bottom: 20px;
}
.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.control-value {
    color: var(--sec-main);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.form-text-hint {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

/* Mode Toggle Buttons (Encrypt / Decrypt) */
.btn-mode {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 18px;
}
.btn-mode.active {
    background: var(--sec-main);
    border-color: var(--sec-main);
    color: white;
}
.btn-mode:hover:not(.active) {
    background: var(--sec-pale);
    border-color: var(--sec-main);
}

/* Mono Input -- utk textarea/field teks & passphrase */
.mono-input {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* Header Row -- 1 baris per security header (toggle + deskripsi + opsi) */
.header-row {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.header-row:last-child {
    margin-bottom: 0;
}
.header-row-top {
    margin-bottom: 4px;
}
.header-name-label {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: var(--sec-dark);
    font-size: 0.92rem;
}
.header-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 10px;
    margin-left: 44px;
}
.header-options {
    margin-left: 44px;
}

/* Warning Box -- HSTS preload, dsb */
.csp-warning-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    line-height: 1.5;
}
.csp-warning-item:last-child {
    margin-bottom: 0;
}
.csp-warning-item i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Generate/Run Button */
.btn-generate {

    background-color: var(--sec-main);
    border: none;
    color: white;
    font-weight: 700;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease;
}
.btn-generate:hover {
    background-color: var(--sec-dark);
    color: white;
}

/* Code Output Box */
.css-output-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.btn-copy {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-copy:hover {
    background: var(--sec-pale);
    border-color: var(--sec-main);
    color: var(--sec-dark);
}
.copy-success {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

/* Format Notice (error/warning) */
.format-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Info Pages Section (About / Contact tabs) */
.info-pages-full {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px 40px;
}
.info-tabs-full {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}
.info-tab-full {
    padding: 10px 18px;
    cursor: pointer;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.info-tab-full.active {
    color: var(--sec-dark);
    border-bottom-color: var(--sec-main);
}
.info-tab-full:hover:not(.active) {
    color: var(--sec-main);
}
.info-content-full {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    color: #334155;
    line-height: 1.7;
}
.info-content-full h3 {
    color: #1e293b;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.info-content-full code {
    background: var(--sec-pale);
    color: var(--sec-dark);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Feedback Form */
.feedback-container-box {
    max-width: 600px;
}
.feedback-title {
    font-size: 1.15rem;
}
.feedback-subtitle {
    color: #64748b;
    font-size: 0.88rem;
}
.feedback-textarea, .feedback-input-email {
    border-color: #cbd5e1;
}
.feedback-textarea:focus, .feedback-input-email:focus {
    border-color: var(--sec-main);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}
.btn-feedback-submit {
    background-color: var(--sec-main);
    border-color: var(--sec-main);
    color: white;
}
.btn-feedback-submit:hover {
    background-color: var(--sec-dark);
    border-color: var(--sec-dark);
}

/* Footer */
.custom-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 18px 0;
    font-size: 0.82rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .main-flex-container {
        flex-direction: column;
    }
    .sidebar-menu {
        width: 100%;
    }
}

/* ============================================================
   AD BANNER -- disisipkan otomatis oleh apply-ad-css.php
   ============================================================ */
.ad-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    background: #eef1f5;
}

.ad-banner.ad-top {
    padding: 10px 0;
    min-height: 90px;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.ad-banner.ad-in-content {
    padding: 10px 0;
    min-height: 60px;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.ad-banner.ad-footer {
    padding: 10px 0;
    min-height: 90px;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.ad-banner span {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px dashed #cbd5e1;
    padding: 8px 24px;
    border-radius: 4px;
}
