/**
 * Order System - Frontend Styles
 */

.os-order-form-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.os-order-form-container h1 {
    margin-top: 0;
    color: #1f2937;
    font-size: 2rem;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* Form Sections */
.os-form-section {
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.os-section-header {
    background: #374151;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.os-section-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.os-search-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.os-search-btn:hover {
    background: #1e40af;
}

.os-search-form {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.os-search-results-list {
    margin-top: 1rem;
}

.os-search-results-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.os-order-item {
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form Grid */
.os-form-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.os-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.os-form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.os-form-group .required {
    color: #dc2626;
}

.os-form-group input[type="text"],
.os-form-group input[type="email"],
.os-form-group input[type="tel"],
.os-form-group input[type="date"],
.os-form-group input[type="time"],
.os-form-group input[type="number"],
.os-form-group select,
.os-form-group textarea {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.os-form-group input:focus,
.os-form-group select:focus,
.os-form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.os-form-group small {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Radio and Checkbox Groups */
.os-radio-group,
.os-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.os-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.os-radio-label input[type="radio"],
.os-checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Signature Section */
.os-signature-section {
    padding: 1.5rem;
}

.os-signature-container {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    background: #f9fafb;
    text-align: center;
}

#os-signature-canvas {
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: crosshair;
    width: 100%;
    max-width: 600px;
    height: 200px;
    margin: 0 auto;
    display: block;
}

.os-signature-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.os-signature-hint {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-style: italic;
}

/* Submit Button */
.os-form-actions {
    margin-top: 2rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.os-submit-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.os-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.os-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.os-btn-loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Messages */
.os-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    display: none;
    border-left: 4px solid;
    animation: slideDown 0.3s ease-out;
}

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

.os-message.show {
    display: block;
}

.os-message.success {
    background: #d1fae5;
    color: #065f46;
    border-left-color: #059669;
}

.os-message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: #dc2626;
}

.os-message.info {
    background: #dbeafe;
    color: #1e40af;
    border-left-color: #2563eb;
}

/* Loading Spinner */
.os-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .os-order-form-container {
        padding: 1rem;
    }

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

    .os-section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    #os-signature-canvas {
        max-width: 100%;
    }
}
