/**
 * Black Spend - Frontend Styles
 */

/* ==========================================================================
   Form Container
   ========================================================================== */

.bs-form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bs-form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 30px 0;
    text-align: center;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.bs-form-row {
    margin-bottom: 24px;
}

.bs-form-row-half {
    display: flex;
    gap: 20px;
}

.bs-form-row-half .bs-form-field {
    flex: 1;
}

.bs-label {
    display: block;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.bs-label .required {
    color: #e74c3c;
}

.bs-input,
.bs-select,
.bs-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.bs-input:focus,
.bs-select:focus,
.bs-textarea:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.bs-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================================================
   Business Select
   ========================================================================== */

.bs-business-select-wrapper {
    position: relative;
}

.bs-searchable-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.bs-add-business-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: transparent;
    border: 2px dashed #6c63ff;
    border-radius: 6px;
    color: #6c63ff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bs-add-business-btn:hover {
    background: #6c63ff;
    color: #fff;
}

/* ==========================================================================
   Add Business Panel
   ========================================================================== */

.bs-add-business-panel {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.bs-add-business-panel h4 {
    margin: 0 0 20px 0;
    color: #1a1a2e;
    font-size: 1.1rem;
}

.bs-button-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.bs-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bs-btn-primary {
    background: #6c63ff;
    color: #fff;
}

.bs-btn-primary:hover {
    background: #5a52d5;
}

.bs-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.bs-btn-secondary:hover {
    background: #d0d0d0;
}

/* ==========================================================================
   Checkbox Group
   ========================================================================== */

.bs-checkbox-group {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.bs-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

.bs-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #6c63ff;
    cursor: pointer;
}

/* ==========================================================================
   Dropzone
   ========================================================================== */

.bs-dropzone {
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.bs-dropzone:hover,
.bs-dropzone.bs-dragover {
    border-color: #6c63ff;
    background: #f5f4ff;
}

.bs-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bs-dropzone-content {
    display: block;
    padding: 30px;
    cursor: pointer;
}

.bs-dropzone-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.bs-dropzone-content p {
    margin: 5px 0;
    color: #666;
}

.bs-dropzone-hint {
    font-size: 0.85rem;
    color: #999 !important;
}

.bs-dropzone-preview {
    position: relative;
    display: inline-block;
    padding: 20px;
}

.bs-dropzone-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.bs-remove-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-remove-preview:hover {
    background: #c0392b;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.bs-submit-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6c63ff 0%, #5a52d5 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bs-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.bs-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.bs-messages {
    margin-top: 20px;
}

.bs-message {
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.bs-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bs-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.bs-form.bs-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.bs-form.bs-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #e0e0e0;
    border-top-color: #6c63ff;
    border-radius: 50%;
    animation: bs-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
    .bs-form-container {
        padding: 20px;
        margin: 10px;
    }

    .bs-form-row-half {
        flex-direction: column;
        gap: 0;
    }

    .bs-form-row-half .bs-form-field {
        margin-bottom: 24px;
    }

    .bs-form-row-half .bs-form-field:last-child {
        margin-bottom: 0;
    }

    .bs-checkbox-group {
        flex-direction: column;
        gap: 12px;
    }

    .bs-button-row {
        flex-direction: column;
    }

    .bs-btn {
        width: 100%;
    }
}
