/* =============================================
   STYLE.CSS - AI SEO Meta Analyzer
   Author: Muhammad Faisal Zulmaulidin
   ============================================= */

:root {
    --primary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* background: linear-gradient(135deg, #f0f4f8, #e8ecef); */
    color: #2a3131;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: var(--dark);
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.subtitle {
    color: #555;
    font-size: 1.1rem;
}

/* Language Switch */
.lang-switch {
    text-align: center;
    margin-bottom: 20px;
}

.lang-switch a {
    display: inline-block;
    padding: 10px 22px;
    margin: 0 8px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid #ddd;
    transition: all 0.3s;
}

.lang-switch a:hover,
.lang-switch a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Form Card */
.form-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.form-card h3 {
    margin-bottom: 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

input, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #dfe4ea;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;  
    }
}

/* Membuat Kata Kunci Utama full width */
.form-group {
    margin-bottom: 20px;
}

/* Button */
button {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ==================== HASIL ANALISIS ==================== */
.result-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.prediction {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.35em;
    font-weight: bold;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.green { background: #d4edda; color: #155724; }
.orange { background: #fff3cd; color: #856404; }
.red { background: #f8d7da; color: #721c24; }

/* Tabel Hasil */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.result-table th,
.result-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.result-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

.result-table tr:hover {
    background: #f8f9fa;
}

.score-row td {
    font-size: 1.4em;
    text-align: center;
    background: #e3f2fd !important;
    font-weight: bold;
    color: #1976d2;
}

/* Recommendation */
.recommendation {
    background: #f8f9fa;
    padding: 20px;
    border-left: 6px solid var(--primary);
    border-radius: 8px;
    margin-top: 25px;
    font-size: 1.02rem;
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 500;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 6px solid var(--danger);
}

/* ==================== HISTORY TABLE ==================== */

.history-table{
    width:100%;
    border-collapse:collapse;
    margin-top:15px;
    font-size:14px;
    background:#fff;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 4px 15px rgba(0,0,0,0.08);
}

.history-table th{
    background:linear-gradient(135deg,#3498db,#2980b9);
    color:white;
    padding:12px;
    text-align:center;
    font-weight:600;
}

.history-table td{
    padding:12px;
    border-bottom:1px solid #eee;
    vertical-align:top;
}

.history-table tr:nth-child(even){
    background:#f8fafc;
}

.history-table tr:hover{
    background:#eef6ff;
    transition:0.3s;
}
.sentiment-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 8px;
}

.sentiment-badge.positive {
    background-color: #d4edda;
    color: #155724;
}

.sentiment-badge.negative {
    background-color: #f8d7da;
    color: #721c24;
}

.sentiment-badge.neutral {
    background-color: #fff3cd;
    color: #856404;
}
/* Kolom skor */
.history-table td:nth-child(5){
    text-align:center;
    font-weight:bold;
    color:#2c3e50;
}

/* Waktu komputasi */
.history-table td:nth-child(6){
    text-align:center;
    color:#8e44ad;
    font-weight:600;
}

/* Status Badge */
.status{
    display:inline-block;
    padding:6px 12px;
    border-radius:20px;
    font-size:12px;
    font-weight:bold;
    text-align:center;
    min-width:90px;
}

.status.good{
    background:#d4edda;
    color:#155724;
}

.status.medium{
    background:#fff3cd;
    color:#856404;
}

.status.bad{
    background:#f8d7da;
    color:#721c24;
}

/* Badge jumlah riwayat */
.count-badge{
    background:#e74c3c;
    color:white;
    padding:2px 8px;
    border-radius:50px;
    font-size:12px;
    margin-left:5px;
}

/* Tombol Riwayat */
.history-btn{
    background:linear-gradient(135deg,#3498db,#2980b9);
    color:white;
    width:auto;
    padding:10px 18px;
}

.history-btn:hover{
    transform:translateY(-2px);
}

/* Footer Modal */
.modal-footer{
    margin-top:20px;
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

.close-btn{
    background:#7f8c8d;
    color:white;
    width:auto;
}

.clear-btn{
    background:#e74c3c;
    color:white;
    width:auto;
}

/* ==================== MODAL HISTORY ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.65);
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    width: 90%;
    max-width: 950px;
    border-radius: 16
}
.history-summary{
    background:linear-gradient(135deg,#ecf5ff,#f8fbff);
    border-left:5px solid #3498db;
    padding:15px 18px;
    margin-bottom:20px;
    border-radius:8px;
    box-shadow:0 2px 10px rgba(0,0,0,0.05);
}

.history-summary p{
    margin:8px 0;
    font-size:14px;
}

.history-summary strong{
    color:#2c3e50;
}