body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.container {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 1600px;
    width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.2rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f8f9fa;
    position: relative;
    transition: all 0.3s ease;
}

.form-row:hover {
    border-color: #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 120px;
    position: relative;
}

.form-group label {
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-group input:focus,
.form-group select:focus {
    border-color: #007BFF;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

/* Validation styles */
.form-group input.valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-group input.invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Phone number input specific styling */
input[name="nomorKontak"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

input[name="nomorKontak"]::placeholder {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: normal;
    font-style: italic;
    color: #6c757d;
}

input[name="nomorKontak"]:focus::placeholder {
    opacity: 0.5;
}

.validation-message {
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-message.error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.validation-message.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.validation-message.info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

.number-group {
    flex: none;
}

.row-number {
    font-size: 18px;
    font-weight: bold;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.buttons {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.buttons button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.buttons button:active {
    transform: translateY(0);
}

.buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.buttons button:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.buttons button:nth-child(2) {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

/* Delete button styles */
.delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.delete-button:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

#loading {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.loading-circle {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading::after {
    content: 'Mengirim data...';
    display: block;
    text-align: center;
    font-weight: 600;
    color: #007bff;
}

#message {
    display: none;
    position: fixed;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 600;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 1001;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#message.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    border-left: 4px solid #0d7377;
}

#message.error {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #fff;
    border-left: 4px solid #cc1616;
}

#message.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border-left: 4px solid #e91e63;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .buttons button {
        width: 100%;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .row-number {
        width: 100%;
        text-align: center;
    }
    
    .delete-button {
        position: static;
        margin-top: 10px;
        width: 100%;
        border-radius: 8px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .form-group input {
        font-size: 14px;
        padding: 10px;
    }
    
    .form-row {
        padding: 15px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus indicators for keyboard navigation */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-group input,
    .form-group select {
        border-width: 3px;
    }
    
    .form-group input:focus,
    .form-group select:focus {
        border-width: 4px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .buttons,
    .delete-button {
        display: none;
    }
    
    #loading,
    #message {
        display: none !important;
    }
}

/* Help section styles */
.help-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.help-section details {
    cursor: pointer;
}

.help-section summary {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    outline: none;
    user-select: none;
}

.help-section summary:hover {
    color: #007bff;
}

.help-section ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.help-section li {
    margin-bottom: 8px;
    color: #6c757d;
}

.help-section kbd {
    background: #e9ecef;
    border: 1px solid #adb5bd;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    color: #495057;
    font-family: monospace;
}

/* Reset button styles */
.reset-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    color: #fff !important;
}

.reset-button:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 100%) !important;
}

/* Additional button animations */
.buttons button {
    position: relative;
    overflow: hidden;
}

.buttons button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.buttons button:active::before {
    width: 300px;
    height: 300px;
}

/* Improved datalist styling */
datalist {
    display: none;
}

input[list] {
    position: relative;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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