/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Content */
.main-content {
    padding: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Input Section */
.input-section {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.input-field {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-field::placeholder {
    color: #a0aec0;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
}

.btn.active {
    background: #2d3748;
    color: white;
}

/* Rencana List */
.rencana-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.rencana-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.rencana-controls .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.rencana-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rencana-list {
    display: grid;
    gap: 16px;
}

.rencana-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.rencana-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}

.rencana-info {
    flex: 1;
}

.rencana-judul {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.rencana-anggaran {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 500;
}

.hapus-btn {
    background: #fed7d7;
    color: #c53030;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.hapus-btn:hover {
    background: #feb2b2;
}

.edit-btn {
    background: #bee3f8;
    color: #2b6cb0;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    margin-right: 8px;
}

.edit-btn:hover {
    background: #90cdf4;
}

.rencana-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Hitung Section */
.hitung-section {
    background: #f0fff4;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #c6f6d5;
}

.hitung-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.periode-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.periode-label {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.periode-buttons {
    display: flex;
    gap: 8px;
}

.periode-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Hasil Section */
.hasil-section {
    background: #ebf8ff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #bee3f8;
}

.hasil-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.hasil-content {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.hasil-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.hasil-judul {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.hasil-anggaran {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
}

.hasil-total {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.total-label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.total-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Footer */
.footer {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px 30px;
    text-align: center;
}

.footer p {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #4a5568;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .hitung-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .periode-buttons {
        justify-content: center;
    }
    
    .hasil-controls {
        flex-direction: column;
    }
    
    .rencana-item {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .rencana-actions {
        justify-content: center;
    }
    
    .rencana-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .rencana-controls .btn {
        width: 100%;
        justify-content: center;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 20px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .input-section,
    .rencana-section,
    .hitung-section,
    .hasil-section {
        padding: 20px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rencana-item {
    animation: fadeIn 0.3s ease;
}

/* Focus styles for accessibility */
.btn:focus,
.input-field:focus,
.hapus-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* PWA Install Button */
.install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Status Message Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* PWA specific styles */
@media (display-mode: standalone) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .header {
        padding-top: env(safe-area-inset-top);
    }
}
