/* ==========================================
   1. Base Styles
   ========================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px 40px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

h1, h2, h3, h4 { color: #2c3e50; text-align: center; margin-bottom: 20px; }
h2 { border-bottom: 2px solid #ecf0f1; padding-bottom: 10px; margin-top: 0; font-size: 1.5em; }
h3 { font-size: 1.2em; text-align: left; border-left: 4px solid #3498db; padding-left: 10px; }
p { margin-bottom: 15px; line-height: 1.6; }

/* ==========================================
   2. Navigation Tabs
   ========================================== */
.nav-tabs { display: flex; gap: 5px; margin-bottom: 25px; border-bottom: 2px solid #ddd; }
.nav-btn {
    padding: 12px 20px; background-color: #f8f9fa; border: 1px solid #ddd; border-bottom: none; border-radius: 8px 8px 0 0;
    cursor: pointer; font-weight: bold; color: #7f8c8d; transition: 0.2s; flex: 1;
}
.nav-btn.active { background-color: #fff; color: #3498db; border-top: 3px solid #3498db; margin-bottom: -2px; border-bottom: 2px solid #fff; }
.nav-btn:hover:not(.active) { background-color: #e9ecef; }
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================
   3. Inputs & Panels
   ========================================== */
.input-section, .simulation-section { background-color: #ecf0f1; border-radius: 8px; padding: 20px; margin-bottom: 25px; border: 1px solid #dde1e5; }
.step-box { background-color: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 20px; margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: bold; color: #34495e; }
input[type="text"], input[type="password"], select {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 16px; box-sizing: border-box; margin-bottom: 15px;
}
.radio-buttons-wrapper { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 8px; }
.radio-buttons-wrapper label { display: inline-flex; align-items: center; gap: 5px; font-weight: normal; cursor: pointer; }

/* ==========================================
   4. Password Suggestions
   ========================================== */
.password-suggestions { margin-bottom: 20px; padding: 10px; background: #e3f2fd; border-radius: 5px; border: 1px dashed #90caf9; }
.suggest-buttons-wrapper { display: flex; gap: 8px; }
.suggest-btn {
    padding: 6px 12px; background-color: #fff; border: 1px solid #90caf9; color: #1976d2;
    border-radius: 4px; cursor: pointer; font-size: 0.9em; transition: 0.2s;
}
.suggest-btn:hover { background-color: #1976d2; color: #fff; }

/* ==========================================
   5. Buttons
   ========================================== */
button { border: none; border-radius: 5px; font-size: 16px; cursor: pointer; transition: 0.3s; padding: 12px 20px; width: 100%; font-weight: bold; }
.button-row { display: flex; gap: 10px; align-items: center; }
#analyzeButton { background-color: #3498db; color: white; flex: 2; }
#analyzeButton:hover { background-color: #2980b9; }

.action-btn-red { background-color: #e74c3c; color: white; }
.action-btn-red:hover { background-color: #c0392b; }
.action-btn-blue { background-color: #3498db; color: white; }
.action-btn-blue:hover { background-color: #2980b9; }
.action-btn-gray { background-color: #95a5a6; color: white; }
#stopButton { flex: 1; }

/* ==========================================
   6. Status & Logs
   ========================================== */
.status-dashboard {
    display: flex; justify-content: space-between; background-color: #2c3e50; color: #00ff00;
    padding: 10px 20px; border-radius: 5px 5px 0 0; border-bottom: 1px solid #444; font-family: 'Consolas', monospace;
}
.status-item { display: flex; flex-direction: column; align-items: center; }
.status-label { font-size: 0.7em; color: #aaa; letter-spacing: 1px; }
.status-value { font-size: 1.2em; font-weight: bold; }

.simulation-display {
    background-color: #1e1e1e; border: 1px solid #333; border-top: none; border-radius: 0 0 5px 5px;
    padding: 15px; height: 300px; overflow-y: auto; font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em; line-height: 1.4; color: #ddd; white-space: pre-wrap;
}
.simulation-display::-webkit-scrollbar { width: 8px; }
.simulation-display::-webkit-scrollbar-track { background: #222; }
.simulation-display::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

.log-line { border-bottom: 1px solid #333; padding: 2px 0; }
.log-line.success { color: #2ecc71; font-weight: bold; background-color: rgba(46, 204, 113, 0.1); }
.log-line.fail { color: #e74c3c; }
.log-line.info { color: #3498db; font-weight: bold; }
.log-line.system { color: #f1c40f; font-style: italic; border-top: 1px dashed #555; margin-top: 5px; padding-top: 5px; }
.log-line.request { color: #bbb; }
.log-line.response-ok { color: #2ecc71; font-weight: bold; }
.log-line.response-err { color: #e74c3c; }

/* ==========================================
   7. Spray & Login UI (Ver.7 Latest)
   ========================================== */
.user-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.user-tag { background: #e3f2fd; color: #0277bd; padding: 5px 12px; border-radius: 15px; font-weight: bold; border: 1px solid #b3e5fc; }
.spray-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; }
.spray-log { height: 250px; }

/* Login Layout */
.login-split-view {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.login-card { flex: 1; min-width: 300px; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #ddd; }
.hacked-list-box { flex: 1.5; min-width: 300px; background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #ddd; }

/* Server Config Panel */
.server-config-panel {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.config-label {
    font-weight: bold;
    color: #1565c0;
    font-size: 0.95em;
}

/* 2FA Toggle */
.defense-toggle {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 0; 
    background: transparent; 
    padding: 0; 
    border: none; 
    justify-content: flex-end;
}
.toggle-text {
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
}
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #27ae60; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 20px; }
.slider.round:before { border-radius: 50%; }

/* Hacker Memo */
.hacker-memo {
    background: #fff9c4; border: 1px solid #fbc02d; padding: 15px; border-radius: 2px;
    margin-bottom: 20px; box-shadow: 2px 2px 5px rgba(0,0,0,0.1); position: relative;
    font-family: 'Segoe Print', 'Bradley Hand', cursive; color: #333; transform: rotate(-1deg);
}
.hacker-memo.hidden { display: none; }
.memo-tape {
    width: 100px; height: 30px; background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.2);
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.hacker-memo h4 { margin: 0 0 5px 0; border: none; text-align: left; font-size: 1.1em; color: #e65100; }
.hacker-memo p { margin: 0; font-size: 1.0em; line-height: 1.4; }

/* Confidential Table */
.confidential-box { margin-top: 20px; border: 2px solid #c0392b; background: #fff; padding: 0; border-radius: 8px; overflow: hidden; animation: slideDown 0.5s; }
.confidential-header { background: #c0392b; color: #fff; padding: 5px 10px; font-weight: bold; text-transform: uppercase; font-size: 0.7em; letter-spacing: 2px; text-align: center; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 5px; }
.data-table th, .data-table td { padding: 6px; border-bottom: 1px solid #eee; font-size: 0.85em; text-align: center; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Guidance Bar & Dialog & Modals */
.guidance-bar { position: fixed; bottom: 0; left: 0; width: 100%; background-color: #333; color: #fff; padding: 15px 20px; display: flex; align-items: center; justify-content: center; gap: 20px; box-shadow: 0 -2px 10px rgba(0,0,0,0.2); z-index: 2000; animation: slideUp 0.3s ease-out; }
.guidance-bar.hidden { display: none; }
#guidanceActionBtn { background: #f1c40f; color: #333; border: none; padding: 8px 20px; border-radius: 4px; font-weight: bold; cursor: pointer; width: auto; }
.guidance-close {
    background: none; border: none; color: #aaa; font-size: 1.5em; cursor: pointer; padding: 0; width: auto;
}
.dialog-content { text-align: center; max-width: 400px; }
.dialog-icon { font-size: 3em; margin-bottom: 10px; }
.dialog-icon.error { color: #e74c3c; }
.dialog-icon.success { color: #2ecc71; }
.dialog-icon.info { color: #3498db; }

/* General Modal */
.modal-overlay { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; }
.modal-content { background-color: #fff; padding: 30px; border-radius: 8px; width: 90%; max-width: 600px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; animation: fadeIn 0.3s; }
.modal-close { top: 15px; right: 20px; color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.modal-options { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
hr { border: 0; border-top: 1px solid #eee; margin: 20px 0; }
#calculationDetails code { background-color: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-family: monospace; color: #d63384; }

.hidden { display: none; }
.full-width { width: 100%; }
footer { text-align: center; margin-top: 30px; color: #888; font-size: 0.8em; }