:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --accent-hover: #c0392b;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --success: #27ae60;
    --success-hover: #219653;
    --warning: #f39c12;
    --bg-color: #f5f7fa;
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.95);
    --header-bg: rgba(255, 255, 255, 0.9);
    --footer-bg: rgba(255, 255, 255, 0.9);
    --input-bg: white;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --bg-color: #1a1a2e;
    --text-color: #e6e6e6;
    --card-bg: rgba(30, 30, 46, 0.95);
    --header-bg: rgba(30, 30, 46, 0.9);
    --footer-bg: rgba(30, 30, 46, 0.9);
    --input-bg: #2d3748;
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
    transition: all 0.3s ease;
}

.generator-container {
    background: var(--card-bg);
    box-shadow: 0 6px 12px var(--shadow-color);
    transition: transform 0.3s ease;
    color: var(--text-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

generator-header {
    background: var(--header-bg);
    color: var(--secondary);
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 1.2rem;
    box-shadow: 0 6px 12px var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Heading compact */
h1 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--secondary); }
h2 { font-size: 1.3rem; margin: 0.8rem 0; color: var(--secondary); }
h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.6rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--primary); }

.subtitle {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #555;
}

.generator-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 6px 12px var(--shadow-color);
    transition: transform 0.3s ease;
    color: var(--text-color);
}
.card:hover { transform: translateY(-3px); }

.template-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .template-selector { grid-template-columns: 1fr; }
}

.options-panel, .output-panel { display: flex; flex-direction: column; }

.option-group { margin-bottom: 1rem; }

label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.3rem;
    color: var(--secondary);
}

/* Input compact */
select, input, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
    background-color: var(--input-bg);
    color: var(--text-color);
}
select:focus, input:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* Buttons compact */
button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px var(--shadow-color);
}

.generate-btn {
    background-color: var(--success);
    margin-top: 1rem;
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
}
.generate-btn:hover { background-color: #219653; }

.copy-btn { background-color: var(--secondary); margin-top: 0.6rem; }
.clear-btn { background-color: var(--accent); margin-top: 0.6rem; }
.clear-btn:hover { background-color: #c0392b; }

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Script output box compact */
.script-output {
    flex-grow: 1;
    background-color: #2c3e50;
    color: #f8f9fa;
    border: none;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-y: auto;
    min-height: 250px;
    max-height: 400px;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.feature-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 3px 8px var(--shadow-color);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 6px 12px var(--shadow-color); }
.feature-icon { font-size: 2rem; color: var(--primary); margin-bottom: 0.6rem; text-align: center; }
.feature-title { font-size: 1.1rem; color: var(--secondary); margin-bottom: 0.5rem; text-align: center; }
.feature-desc { color: #666; text-align: center; flex-grow: 1; font-size: 0.85rem; }

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    background: var(--footer-bg);
    border-radius: 10px;
    color: var(--dark);
    font-size: 0.9rem;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.7rem 1rem;
    background: var(--success);
    color: white;
    border-radius: 5px;
    box-shadow: 0 3px 8px var(--shadow-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-size: 0.85rem;
}
.notification.show { transform: translateX(0); }

/* Description box */
.template-description {
    background: #e3f2fd;
    padding: 0.7rem;
    border-radius: 6px;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #555;
}
.dark-mode .template-description { background: #2d3748; color: #e6e6e6; }

/* Theme Toggle */
.theme-toggle {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}
.theme-toggle:hover { transform: rotate(30deg); }

/* Sidebar Donation */
.donation-sidebar {
    position: fixed;
    top: 70px;
    right: -280px;
    width: 280px;
    height: calc(100vh - 70px);
    background: var(--card-bg);
    box-shadow: -5px 0 12px var(--shadow-color);
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 15px;
    overflow-y: auto;
    color: var(--text-color);
    border-radius: 8px 0 0 8px;
}
.donation-sidebar.open { right: 0; }

.donation-content { margin-top: 15px; }

.donation-option {
    background: var(--input-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.donation-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}
.donation-option h4 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.donation-option p {
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* Tombol donasi hijau */
.donation-btn {
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.donation-btn:hover {
    background: var(--success-hover) !important;
    color: white !important;
    transform: translateY(-1px);
}

/* Tombol close sidebar merah */
.close-sidebar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}
.close-sidebar:hover { background: var(--accent-hover); }

/* Tombol toggle sidebar */
.donation-toggle {
    position: fixed;
    top: 120px;
    right: 0;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px 0 0 6px;
    padding: 10px 14px;
    cursor: pointer;
    z-index: 999;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.donation-toggle:hover { background: var(--accent-hover); }

.header-controls { display: flex; gap: 10px; }

/* Responsive tweaks */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1rem; }
    .generate-btn { font-size: 0.9rem; padding: 0.6rem; }
    .script-output { min-height: 200px; max-height: 300px; font-size: 0.8rem; }
    .donation-toggle { height: 100px; font-size: 0.75rem; }
}
