/* Modern UI Components - Shared Styles */

/* Cards */
.update-card, .detail-card, .sample-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease-in-out;
}

.update-card:hover, .detail-card:hover, .sample-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.update-card .card-header, .detail-card .card-header, .sample-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
    border: none;
    padding: 20px;
    color: white;
}

.update-card .card-header h6, .detail-card .card-header h6, .sample-card .card-header h6 {
    color: white !important;
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Form Sections */
.form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h5, .form-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.form-section h5 i, .form-section h6 i {
    margin-right: 8px;
    color: #667eea;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 12px 15px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control-plaintext {
    padding: 12px 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #495057;
}

/* Modern Buttons */
.btn-modern {
    border-radius: 20px;
    padding: 12px 25px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 10px;
    margin-bottom: 10px;
    min-height: 44px;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary.btn-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary.btn-modern:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary.btn-modern {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    color: #495057;
}

.btn-outline-secondary.btn-modern {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary.btn-modern:hover {
    background: #6c757d;
    color: white;
}

.btn-info.btn-modern {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
}

.btn-warning.btn-modern {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
}

.btn-danger.btn-modern {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border: none;
}

.btn-success.btn-modern {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    border: none;
    color: white;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* Input Groups */
.input-group .btn {
    border-radius: 0 8px 8px 0;
}

.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

/* Tables */
.table-modern, .custom-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table-modern thead th, .custom-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px;
}

.table-modern tbody td, .custom-table tbody td {
    padding: 12px 15px;
    border-color: #e9ecef;
    vertical-align: middle;
}

.table-modern tbody tr:hover, .custom-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-modern {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Status Indicators */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

.status-active, .status-enabled, .status-true {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-inactive, .status-disabled, .status-false {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Alerts */
.alert-modern {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-modern i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-modern > *:not(i) {
    flex: 1;
}

.alert-warning.alert-modern {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* Apply flexbox layout to all Bootstrap alerts for consistent icon placement */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert > *:not(i):not(button) {
    flex: 1;
}

/* Info Items */
.info-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.875rem;
    min-width: 120px;
    margin-right: 15px;
}

.info-value {
    color: #495057;
    font-size: 0.875rem;
    text-align: right;
    flex: 1;
    word-wrap: break-word;
}

/* Action Buttons */
.action-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Validation */
.text-danger {
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-modern {
        width: 100%;
        max-width: 280px;
    }
}

/* Tab Navigation */
.detail-card .card-header .nav-tabs {
    border: none;
    margin-bottom: -20px;
}

.detail-card .card-header .nav-tabs .nav-link {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.detail-card .card-header .nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.detail-card .card-header .nav-tabs .nav-link.active {
    background: white;
    color: #667eea;
    border-color: white;
    font-weight: 600;
}

/* Modal Styling */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    border: none;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

/* Additional Alert Variants */
.alert-info.alert-modern {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-danger.alert-modern {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-success.alert-modern {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

/* Button Size Variants */
.btn-sm.btn-modern {
    padding: 8px 16px;
    font-size: 0.75rem;
    min-height: 36px;
}

/* Configuration Options */
.config-option {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.config-option:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.config-option-disabled {
    opacity: 0.6;
    background: #f8f9fa;
}

.config-option-disabled:hover {
    border-color: #e9ecef;
    box-shadow: none;
}

.config-option-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.config-option-title {
    flex: 1;
    margin-right: 20px;
}

.config-option-title strong {
    display: block;
    color: #495057;
    font-size: 1rem;
    margin-bottom: 5px;
}

.config-option-description {
    display: block;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

.config-option-control {
    flex-shrink: 0;
}

.config-option-help {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f3f4;
}

/* Custom Switch */
.custom-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.custom-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-switch-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 32px;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
}

.custom-switch-indicator {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.custom-switch-input:checked + .custom-switch-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.custom-switch-input:focus + .custom-switch-label {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.custom-switch-input:checked + .custom-switch-label .custom-switch-indicator {
    transform: translateX(28px);
}

.custom-switch-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(calc(-50% - 5px));
    line-height: 1;
    transition: .4s;
    z-index: 1;
    pointer-events: none;
}

.custom-switch-input:checked + .custom-switch-label .custom-switch-text::before {
    content: attr(data-on);
    position: absolute;
    left: 8px;
}

.custom-switch-input:not(:checked) + .custom-switch-label .custom-switch-text::before {
    content: attr(data-off);
    position: absolute;
    right: 8px;
}

.custom-switch.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.custom-switch.disabled .custom-switch-label {
    cursor: not-allowed;
}

/* Status Badge Enhancements */
.status-badge.status-active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.status-inactive {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design for Configuration */
@media (max-width: 768px) {
    .config-option-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .config-option-title {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .config-option-control {
        align-self: flex-start;
    }
    
    .custom-switch {
        width: 50px;
        height: 28px;
    }
    
    .custom-switch-indicator {
        height: 24px;
        width: 24px;
    }
    
    .custom-switch-input:checked + .custom-switch-label .custom-switch-indicator {
        transform: translateX(22px);
    }
    
    .custom-switch-text {
        line-height: 1;
        font-size: 0.65rem;
    }
    
    .custom-switch-input:checked + .custom-switch-label .custom-switch-text::before {
        left: 6px;
    }
    
    .custom-switch-input:not(:checked) + .custom-switch-label .custom-switch-text::before {
        right: 6px;
    }
}
