/**
 * Form Styles for Page-Based CRUD Operations
 */

/* Company Toggle Styles */
.company-toggle-container {
    margin-top: 8px;
}

.toggle-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.toggle-buttons .btn {
    border-radius: 20px;
    font-size: 13px;
    padding: 6px 16px;
    transition: all 0.2s ease;
}

.toggle-buttons .btn.active {
    background-color: var(--color-primary, #007bff);
    border-color: var(--color-primary, #007bff);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.toggle-buttons .btn:not(.active) {
    background-color: white;
    border-color: #dee2e6;
    color: #6c757d;
}

.toggle-buttons .btn:not(.active):hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.company-section {
    display: none;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-top: 8px;
}

.company-section.active {
    display: block;
}

.company-section .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.company-section .form-group:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .toggle-buttons {
        flex-direction: column;
    }
    
    .company-section .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 24px;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumb-item {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item:hover {
    color: #495057;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #adb5bd;
}

/* Form Container */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Form Panels */
.form-panel {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.panel-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 16px 24px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    margin: 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h3 i {
    color: #6c757d;
    font-size: 14px;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.panel-body {
    padding: 24px;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
/*    flex-direction: row;*/
}

.form-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-control {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Only show invalid styles after form validation (Bootstrap pattern) */
.was-validated .form-control:invalid {
    border-color: #ef4444;
}

.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    position: relative;
    background: #fff;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* Identifier Fields */
.identifiers-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.identifier-field {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
}

.identifier-field .form-grid {
    grid-template-columns: 1fr 2fr auto;
    align-items: end;
}

/* Form Actions */
.form-actions-panel {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 24px;
    border-radius: 0 0 8px 8px;
    margin-top: 24px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Details Container */
.details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.details-panels {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Details Panel */
.details-panel {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 500;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #374151;
    font-size: 14px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* Group and Identifier Badges */
.group-badge, .identifier-badge {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}

.groups-list, .identifiers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.identifier-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.identifier-type {
    background: #3b82f6;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.identifier-value {
    font-family: monospace;
    font-size: 13px;
    color: #374151;
}

/* Settings List */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.setting-value.enabled {
    color: #059669;
    font-weight: 500;
}

.setting-value.disabled {
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container,
    .details-container {
        padding: 0 16px;
    }

    .form-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .panel-body {
        padding: 16px;
    }

    .form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .breadcrumb-nav {
        padding: 12px 16px;
    }

    .identifier-field .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation */
.form-panel,
.details-panel {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Section Divider */
.form-section-divider {
    margin: 32px 0 24px 0;
    padding: 0 0 16px 0;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.form-section-divider h4 {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-divider h4 i {
    color: #6c757d;
    font-size: 16px;
}

.form-section-divider .form-help {
    color: #6c757d;
    font-size: 13px;
    margin: 0;
    font-style: italic;
}

/* Vehicle Section Specific Styles */
.form-section-divider h4 .fa-car {
    color: #28a745;
}

/* Enhanced visual separation for first section divider */
.form-section-divider:first-of-type {
    margin-top: 24px;
}
