/* Custom Styles untuk Modul Pembelajaran Junior Web Developer */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
}

/* Icon Box */
.icon-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Unit Cards */
.unit-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.unit-card .card-header {
    border-bottom: none;
    padding: 1.5rem;
}

.unit-card .card-body {
    padding: 1.5rem;
}

.unit-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 1.5rem;
}

/* Progress Tracker */
.progress-tracker .progress {
    height: 10px;
    border-radius: 10px;
}

.progress-tracker .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 15px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.unit-card {
    animation: fadeInUp 0.6s ease forwards;
}

.unit-card:nth-child(1) { animation-delay: 0.1s; }
.unit-card:nth-child(2) { animation-delay: 0.2s; }
.unit-card:nth-child(3) { animation-delay: 0.3s; }
.unit-card:nth-child(4) { animation-delay: 0.4s; }
.unit-card:nth-child(5) { animation-delay: 0.5s; }
.unit-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .icon-box {
        width: 60px;
        height: 60px;
    }
    
    .icon-box i {
        font-size: 1.5rem !important;
    }
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom List Styling */
.list-unstyled li {
    padding: 0.25rem 0;
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

.progress-tracker .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Additional CSS for Form Validation and Error Handling */

/* Form validation styles */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1050;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

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

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.notification button {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 1rem;
}

/* Loading states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

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

/* Form enhancements */
.form-group {
    position: relative;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

/* Success states */
.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* Table responsiveness improvements */
@media (max-width: 768px) {
    .table-container table {
        font-size: 0.75rem;
    }
    
    .table-container th,
    .table-container td {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Print styles */
@media print {
    .btn, .notification {
        display: none !important;
    }
    
    .form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .form-container,
    .data-container {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background-color: #3d3d3d;
        border-color: #555;
        color: #e0e0e0;
    }
    
    th {
        background-color: #3d3d3d;
        color: #e0e0e0;
    }
    
    tr:hover {
        background-color: #3d3d3d;
    }
}