/* assets/style.css */

/* --- Global Styles & Futuristic Theme --- */
:root {
    --bg-dark: #1a1a2e;
    --bg-light: #2a2a3e;
    --primary-accent: #00f5c8;   /* Cyan */
    --secondary-accent: #e94560; /* Magenta */
    --manage-accent: #3498db;     /* Blue */
    --text-light: #e0e0e0;
    --text-dark: #a0a0b0;
    --border-color: #4a4a5e;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 960px;
    margin: 20px auto;
    padding: 25px;
    background-color: var(--bg-light);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

/* --- App Header & Footer --- */
.app-header {
    background: linear-gradient(45deg, var(--bg-light), #1a1a2e);
    color: #ffffff;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 3px solid var(--primary-accent);
}
.app-header h1 {
    margin: 0 0 8px 0;
    font-size: 2.4em;
    font-weight: 700;
    letter-spacing: 1px;
}
.app-header p {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-dark);
}

.app-footer {
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding: 20px 25px;
    text-align: center;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
}
.app-footer a {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.2s;
}
.app-footer a:hover {
    color: #ffffff;
}


/* --- General Header & Buttons --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}
header h1 {
    margin: 0;
    font-size: 1.8em;
    color: #ffffff;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    background-color: #4a4a5e; /* Default dark grey */
    color: var(--text-light);
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--primary-accent);
    color: var(--bg-dark);
    font-weight: 700;
}
.btn-manage {
    background-color: var(--manage-accent);
    color: #ffffff;
}
.btn-delete {
    background-color: var(--secondary-accent);
    color: #ffffff;
}

.actions-bar {
    margin-bottom: 20px;
    text-align: right;
}

/* --- Table Styles --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
table th, table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}
table th {
    background-color: #3a3a4e;
    font-weight: 600;
    color: #ffffff;
}
table tbody tr {
    transition: background-color 0.2s;
}
table tbody tr:hover {
    background-color: #333347;
}
td.actions .btn {
    padding: 6px 12px;
    font-size: 0.85em;
    margin-right: 5px;
}

/* --- General Form Styles --- */
.config-form .form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
}
.config-form .form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
.config-form h3 {
    font-size: 1.3em;
    color: var(--primary-accent);
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
    color: var(--text-dark);
}
.form-group p.description {
    font-size: 0.85em;
    color: #8a8a9e;
    margin-top: 8px;
    line-height: 1.5;
}
.form-actions {
    margin-top: 30px;
    text-align: right;
}
.btn-save {
    padding: 12px 30px;
    font-size: 1.1em;
}

/* --- Standard Inputs (Textarea, Select) --- */
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    color: var(--text-light);
    font-family: inherit;
    transition: all 0.2s ease;
}
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 245, 200, 0.2);
}
.form-group select[multiple] {
    padding: 10px;
    height: 200px;
}

/* --- Ad Code Page Specific --- */
.ad-code-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    background-color: var(--bg-dark);
    border: 1px solid var(--primary-accent);
    border-radius: 8px;
    color: #ffffff;
    resize: none;
}


/* --- FUTURISTIC FLOATING LABEL INPUTS (from PopGen) --- */
.futuristic-form-group {
    position: relative;
    margin-bottom: 35px;
}
.futuristic-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 10px 10px 40px;
    background-color: transparent;
    font-size: 1.1em;
    color: var(--text-light);
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.futuristic-input:focus {
    outline: none;
    border-bottom-color: var(--primary-accent);
}
.futuristic-label {
    position: absolute;
    top: 10px;
    left: 40px;
    font-size: 1.1em;
    color: var(--text-dark);
    pointer-events: none;
    transition: all 0.3s ease;
}
.futuristic-input:focus + .futuristic-label,
.futuristic-input:not(:placeholder-shown) + .futuristic-label {
    top: -20px;
    left: 0;
    font-size: 0.9em;
    color: var(--primary-accent);
}
.form-icon {
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    fill: var(--border-color);
    transition: fill 0.3s;
}
.futuristic-input:focus ~ .form-icon {
    fill: var(--primary-accent);
}
.toggle-password-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    width: 24px;
    height: 24px;
}
.toggle-password-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--text-dark);
}
.toggle-password-icon svg:hover {
    fill: var(--primary-accent);
}

/* --- Login & Form Styles --- */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 60px auto;
    padding: 30px 35px;
}
.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #ffffff;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    color: var(--text-light);
}
.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    border-color: var(--primary-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 245, 200, 0.2);
}
.login-container .btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
}

/* --- Flash Messages --- */
.message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.95em;
    border-left-width: 5px;
    border-left-style: solid;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
.message.success {
    background-color: rgba(0, 245, 200, 0.1);
    border-color: var(--primary-accent);
    color: #cffff3;
}
.message.error {
    background-color: rgba(233, 69, 96, 0.1);
    border-color: var(--secondary-accent);
    color: #ffced5;
}
.message.info {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: var(--manage-accent);
    color: #cce7ff;
}
.flash-message.fade-out {
    opacity: 0;
}

/* --- Country Picker Specific Styles (with BUG FIX) --- */
.country-picker-container {
    position: relative;
}
.country-dropdown {
    position: absolute;
    background-color: #2c3e50;
    border: 1px solid #4a627a;
    border-radius: 8px;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none; /* Sembunyi secara default */
    top: 42px; /* BUG FIX: Mengganti margin-top dengan properti top untuk kontrol posisi yang lebih presisi */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.country-dropdown-item {
    padding: 12px 18px;
    color: #ecf0f1;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    font-size: 14px;
}
.country-dropdown-item:last-child {
    border-bottom: none;
}
.country-dropdown-item:hover {
    background-color: #3498db;
}
.country-tags-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.country-tag {
    background-color: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.country-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    font-family: sans-serif;
}
.form-icon-button {
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    fill: #95a5a6;
}
/* --- Tambahan untuk Teks Berkilau --- */
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow:
      0 0 4px #fff,
      0 0 11px var(--primary-accent),
      0 0 19px var(--primary-accent),
      0 0 40px var(--primary-accent),
      0 0 80px var(--primary-accent);
    opacity: 1;
  }
  20%, 24%, 55% {
    text-shadow: none;
    opacity: 0.8;
  }
}

.futuristic-glow {
    font-weight: bold;
    color: #f0f8ff; /* AliceBlue, warna terang yang bagus */
    animation: flicker 4s linear infinite;
}