/* Style Guide CSS - Vanilla CSS tanpa library */

:root {
    /* Color Palette - Primary */
    --primary-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    
    /* Status Colors */
    --status-in-progress: #e3f2fd;
    --status-done: #e8f5e8;
    --status-overtime: #fff3e0;
    
    /* Tag Colors */
    --tag-project-tomahawk: #fff9c4;
    --tag-project-astronot: #f5f5f5;
    --tag-project-bau: #e1f5fe;
    
    /* Button Colors */
    --btn-primary: #333333;
    --btn-secondary: #ffffff;
    --btn-danger: #ff4444;
    
    /* Form States */
    --form-error: #dc3545;
    --form-success: #28a745;
    --form-warning: #ffc107;
    --form-info: #007bff;
    
    /* Layout */
    --border-color: #e0e0e0;
    --border-radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Container */
    --container-padding: 24px;
    --card-padding: 20px;
    --card-margin-bottom: 16px;
    --section-margin-bottom: 32px;
}

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

body {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--primary-bg);
}

button,
input,
select,
textarea,
.btn,
.form-control,
.form-input,
.form-select {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: var(--spacing-lg);
}

.main-content {
    flex: 1;
    background-color: var(--primary-bg);
    display: flex;
    flex-direction: column;
}

.header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-lg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.content {
    flex: 1;
    padding: var(--spacing-lg);
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-md);
    transition: box-shadow 0.2s ease;
}

.card-main {
    padding: var(--card-padding);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-md);
}

.card-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.card-header-title {
    flex: 1;
}

.card-header-actions {
    flex-shrink: 0;
}

.card-title {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn {
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

.btn-primary {
    background: var(--text-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #555555;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #cccccc;
}

.btn-danger {
    background: #c62828;
    color: #ffffff;
}

.btn-danger:hover {
    background: #e53935;
}

.btn-warning {
    background: #ffc107;
    color: var(--text-primary);
}

.btn-warning:hover {
    background: #ffb300;
}

.btn-info {
    background: #007bff;
    color: #ffffff;
}

.btn-info:hover {
    background: #0056b3;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: var(--spacing-sm);
}

/* Button Utility Classes */
.btn-block {
    width: 100%;
    display: block;
}

.btn-outline-primary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-outline-primary:hover {
    background: var(--text-primary);
    color: #ffffff;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--text-secondary);
    color: #ffffff;
}

.btn-outline-danger {
    background: transparent;
    color: #c62828;
    border: 2px solid #c62828;
}

.btn-outline-danger:hover {
    background: #c62828;
    color: #ffffff;
}

.btn-outline-success {
    background: transparent;
    color: #28a745;
    border: 2px solid #28a745;
}

.btn-outline-success:hover {
    background: #28a745;
    color: #ffffff;
}

.btn-outline-warning {
    background: transparent;
    color: #ffc107;
    border: 2px solid #ffc107;
}

.btn-outline-warning:hover {
    background: #ffc107;
    color: var(--text-primary);
}

.btn-outline-info {
    background: transparent;
    color: #007bff;
    border: 2px solid #007bff;
}

.btn-outline-info:hover {
    background: #007bff;
    color: #ffffff;
}

/* Button with icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-icon i {
    font-size: 1em;
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

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

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-control,
.form-input,
.form-select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    height: 40px;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-input:focus,
.form-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.form-control:hover,
.form-input:hover,
.form-select:hover {
    border-color: #cccccc;
}

.form-control.error,
.form-input.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    outline-color: #dc3545;
}

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin: 0 0 4px 0;
}

.form-section {
    margin-bottom: 32px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.form-section-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #333333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666666;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.password-toggle:hover {
    color: #333333;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    background: #f5f7fa;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: #fafafa;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge-success {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-secondary {
    background: #f5f5f5;
    color: var(--text-secondary);
}

.badge-info {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-warning {
    background: #fff3e0;
    color: #f57c00;
}

.badge-danger {
    background: #ffe9ec;
    color: #c62828;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: var(--spacing-md);
}

.alert-success {
    background: #eaf7ee;
    border-color: #cfead6;
    color: #2e7d32;
}

.alert-danger {
    background: #ffe9ec;
    border-color: #ffccd2;
    color: #c62828;
}

.alert-warning {
    background: #fff7e6;
    border-color: #ffe7b5;
    color: #b26a00;
}

.alert-info {
    background: #e7f1ff;
    border-color: #cfe3ff;
    color: #0d6efd;
}

.alert-icon {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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


.nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #f5f5f5;
    color: var(--text-primary);
}

.nav-link.active {
    background-color: #e3f2fd;
    color: #1976d2;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--card-bg);
    min-width: 200px;
    box-shadow: var(--shadow-hover);
    border-radius: var(--border-radius);
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .current {
    background-color: var(--text-primary);
    color: #ffffff;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.me-2 {
    margin-right: var(--spacing-sm);
}

.ms-2 {
    margin-left: var(--spacing-sm);
}

.w-100 {
    width: 100%;
}

.d-inline {
    display: inline;
}

.d-grid {
    display: grid;
}

.gap-2 {
    gap: var(--spacing-sm);
}

.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-md);
}

.col-md-2 { grid-column: span 2; }
.col-md-3 { grid-column: span 3; }
.col-md-4 { grid-column: span 4; }
.col-md-6 { grid-column: span 6; }
.col-md-8 { grid-column: span 8; }
.col-md-10 { grid-column: span 10; }
.col-md-12 { grid-column: span 12; }

.col-lg-4 { grid-column: span 4; }
.col-lg-6 { grid-column: span 6; }

/* Tablet Responsive Button Styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .btn {
        padding: 10px 18px;
        font-size: 15px;
        min-height: 42px;
    }
    
    .btn-sm {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .btn-group {
        gap: 10px;
    }
    
    /* Button hover effects for tablet */
    .btn:hover {
        transform: translateY(-1px);
    }
    
    .btn:active {
        transform: scale(0.99);
        transition: transform 0.1s ease;
    }
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .row {
        grid-template-columns: 1fr;
    }
    
    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-10,
    .col-md-12 {
        grid-column: span 1;
    }
    
    .card-header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-header-actions {
        margin-top: 16px;
    }
    
    .card-header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-section {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    /* Responsive Button Styles for Mobile */
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
        width: 100%;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-sm {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Button hover effects for touch devices */
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .btn-primary:active {
        background: #444444;
    }
    
    .btn-secondary:active {
        background: #e8e8e8;
    }
    
    .btn-danger:active {
        background: #b71c1c;
    }
    
    .btn-warning:active {
        background: #ff8f00;
    }
    
    .btn-info:active {
        background: #0056b3;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 16px;
    }
    
    .form-section-title {
        font-size: 14px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-input,
    .form-select,
    .form-control {
        font-size: 13px;
        padding: 8px 10px;
        height: 36px;
    }
    
    /* Small Mobile Button Styles */
    .btn {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
        font-weight: 600;
        letter-spacing: 0.5px;
    }
    
    .btn-sm {
        padding: 12px 16px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .btn-group {
        gap: 16px;
    }
    
    /* Enhanced touch feedback for small mobile */
    .btn:active {
        transform: scale(0.96);
        transition: transform 0.08s ease;
    }
    
    /* Larger touch targets for better accessibility */
    .btn::before {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        z-index: -1;
    }
}
