/* Restaurant Management System - Forms Specific Styles */

/* Form Container */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Headers */
.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 10px 0;
}

.form-subtitle {
    color: #718096;
    font-size: 16px;
    margin: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label.required::after {
    content: ' *';
    color: #f56565;
}

/* Form Row Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row.three-columns {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row.four-columns {
        grid-template-columns: repeat(4, 1fr);
    }
}

.form-row .form-group {
    margin-bottom: 0;
}

/* Input Styles */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #ffffff;
}

.form-control:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.form-control::placeholder {
    color: #a0aec0;
}

/* Input Variants */
input.form-control,
select.form-control,
textarea.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Select Dropdown */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.form-check-input {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.form-check-label {
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    user-select: none;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.checkbox-group .form-check {
    margin-bottom: 0;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.radio-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    border-radius: 0;
    border-right: none;
}

.input-group .form-control:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group .form-control:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right: 2px solid #e2e8f0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    background-color: #f9fafb;
    border: 2px solid #e2e8f0;
    border-left: none;
}

.input-group-text:first-child {
    border-left: 2px solid #e2e8f0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group-text:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    padding: 20px 16px 8px 16px;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 16px;
    height: 100%;
    padding: 20px 0 0 0;
    pointer-events: none;
    border: none;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-12px) translateX(0.15rem);
}

/* File Upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: #f7fafc;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.file-upload-icon {
    font-size: 24px;
    margin-bottom: 10px;
    color: #9ca3af;
}

.file-upload-text {
    font-size: 14px;
    font-weight: 500;
}

.file-upload-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

/* Form Validation */
.form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 6px;
    font-size: 14px;
    color: #10b981;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 6px;
    font-size: 14px;
    color: #f87171;
}

/* Help Text */
.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

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

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.form-actions.center {
    justify-content: center;
}

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

.form-actions.full-width .btn {
    flex: 1;
}

/* Modal Forms */
.modal-form {
    max-width: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

.modal-form .form-group {
    margin-bottom: 18px;
}

.modal-form .form-actions {
    margin-top: 20px;
    padding-top: 15px;
}

/* Inline Forms */
.form-inline {
    display: flex;
    align-items: end;
    gap: 15px;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.form-inline .btn {
    flex-shrink: 0;
}

/* Search Forms */
.search-form {
    position: relative;
    max-width: 400px;
}

.search-form .form-control {
    padding-right: 45px;
}

.search-form .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.search-form .search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

/* Filter Forms */
.filter-form {
    display: flex;
    align-items: end;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filter-form .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.filter-form .btn {
    flex-shrink: 0;
}

/* Multi-step Forms */
.form-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.form-step {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}

.form-step.active {
    color: #667eea;
}

.form-step.completed {
    color: #10b981;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    margin-right: 10px;
}

.form-step.active .step-number {
    background: #667eea;
    color: white;
}

.form-step.completed .step-number {
    background: #10b981;
    color: white;
}

.step-connector {
    width: 50px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 15px;
}

.form-step.completed + .form-step .step-connector {
    background: #10b981;
}

/* Form Loading States */
.form-loading {
    position: relative;
    overflow: hidden;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.form-loading .form-control,
.form-loading .btn {
    pointer-events: none;
    opacity: 0.6;
}

/* Form Error States */
.form-error {
    padding: 15px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    margin-bottom: 20px;
}

.form-error-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.form-error-list {
    margin: 0;
    padding-left: 20px;
}

/* Form Success States */
.form-success {
    padding: 15px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 20px;
        margin: 0 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-inline .form-group {
        min-width: auto;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form .form-group {
        min-width: auto;
    }
    
    .form-steps {
        flex-direction: column;
        align-items: center;
    }
    
    .step-connector {
        width: 2px;
        height: 30px;
        margin: 10px 0;
    }
}

/* Print Styles */
@media print {
    .form-actions {
        display: none;
    }
    
    .form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .form-control {
        border: 1px solid #000;
        background: transparent;
    }
}