* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 16px;
}

.form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
}

.nav-buttons {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.result-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.result-card h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.result-card .value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.result-card .value.blue {
    color: #28a745;
}

.result-card .value.red {
    color: #dc3545;
}

.sinergi-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.sinergi-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.sinergi-section p {
    margin-bottom: 10px;
    color: #666;
}

.list {
    margin-bottom: 20px;
}

.list-item {
    display: block;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
}

.list-item:hover {
    background: #e9ecef;
}

.list-content h4 {
    margin-bottom: 5px;
    color: #667eea;
}

.list-content p {
    margin-bottom: 5px;
    color: #666;
}

.list-content small {
    color: #999;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    flex: 1;
    min-width: 80px;
    padding: 10px 15px;
    text-align: center;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Kata List */
.kata-list {
    display: grid;
    gap: 10px;
}

.kata-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.kata-ke {
    font-weight: 600;
    color: #667eea;
    min-width: 70px;
}

.kata-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Huruf Grid */
.huruf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.huruf-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #667eea;
}

.huruf-char {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.huruf-nilai {
    font-size: 18px;
    color: #333;
    margin-top: 5px;
}

.huruf-ke {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
}

/* Summary Box */
.summary-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 28px;
    font-weight: bold;
}

.summary-value.blue { color: #28a745; }
.summary-value.red { color: #dc3545; }

.summary-detail {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    word-break: break-word;
}

/* Momentum Stream */
.ms-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
    margin-bottom: 20px;
}

.ms-box h4 {
    margin-bottom: 15px;
    text-align: center;
}

.ms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ms-item {
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.ms-label {
    font-size: 12px;
    opacity: 0.9;
}

.ms-count {
    font-size: 20px;
    font-weight: bold;
    margin: 5px 0;
}

.ms-value {
    font-size: 14px;
    opacity: 0.9;
}

/* Essence Table */
.essence-table-wrapper {
    overflow-x: auto;
    margin-top: 10px;
}

.essence-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.essence-table th, .essence-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.essence-table th {
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
}

.essence-table tr:hover {
    background: #f0f0f0;
    cursor: pointer;
}

.essence-table .master-row {
    background: #fff3cd;
}

.essence-table .master-num {
    color: #dc3545;
    font-weight: bold;
}

/* Prediksi */
.info-box {
    background: #e7f3ff;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin: 15px 0;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.prediksi-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    color: white;
    margin: 20px 0;
}

.prediksi-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.prediksi-header h2 {
    margin-bottom: 10px;
}

.prediksi-nilai {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nilai-label {
    font-size: 16px;
    opacity: 0.9;
}

.nilai-angka {
    font-size: 48px;
    font-weight: bold;
}

.prediksi-arti {
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
}

/* List Badge */
.list-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    margin-bottom: 5px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Responsive */
@media (max-width: 480px) {
    .summary-box {
        grid-template-columns: 1fr;
    }
    
    .ms-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .huruf-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .nilai-angka {
        font-size: 36px;
    }
}

/* MS Total Box */
.ms-total {
    background: rgba(255,255,255,0.25);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.3);
}

.ms-total-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.ms-total-value {
    font-size: 36px;
    font-weight: bold;
    margin: 5px 0;
}

.ms-total-value.blue { color: #a8ff78; } /* Hijau terang untuk background ungu */
.ms-total-value.red { color: #ff7675; }  /* Merah terang */

.ms-total-detail {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 5px;
}