/**
 * User Subdomain Manager - Frontend Styles
 */

.usm-form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
}

.usm-form-header {
    margin-bottom: 30px;
}

.usm-form-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    /* color: #333; */
    text-transform: uppercase;
}

.usm-form-description {
    font-size: 16px;
    /* color: #666; */
    margin: 0;
}

/* Notices */
.usm-notice {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
    border-left: 4px solid;
}

.usm-notice p {
    margin: 0;
    font-size: 15px;
}

.usm-notice-error {
    background-color: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}

.usm-notice-success {
    background-color: #f0fdf4;
    border-left-color: #16a34a;
    color: #166534;
}

.usm-notice-info {
    background-color: #eff6ff;
    border-left-color: #2563eb;
    color: #1e40af;
}

.usm-subdomain-link {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.usm-subdomain-link:hover {
    text-decoration: underline;
}

/* Form Fields */
.usm-field {
    margin-bottom: 25px;
}

.usm-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    /* color: #333; */
}

.usm-required {
    color: #dc2626;
}

.usm-input,
.usm-textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid;
    border-radius: 4px;
    /* background-color: #fff; */
    transition: border-color 0.2s;
}

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

.usm-input.is-invalid {
    border-color: #dc2626;
}

.usm-textarea {
    resize: vertical;
    min-height: 120px;
}

.usm-field-description {
    font-size: 14px;
    /* color: #787878; */
    margin: 8px 0 0;
}

.usm-field-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 8px;
}

.usm-subdomain-preview {
    font-weight: 600;
    /* color: #2563eb; */
}

/* Input Group */
.usm-input-group {
    position: relative;
    display: flex;
}

.usm-input-prefix {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    /* background-color: #f3f4f6; */
    border: 1px solid;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-weight: 500;
    /* color: #6b7280; */
}

.usm-input-with-prefix {
    border-radius: 0 4px 4px 0;
}

/* File Input */
.usm-input-file {
    padding: 10px 0;
    cursor: pointer;
}

.usm-image-preview {
    margin-bottom: 15px;
}

.usm-image-preview img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    border: 2px solid;
}

/* Products */
.usm-product-search {
    margin-bottom: 15px;
}

.usm-selected-products {
    margin-bottom: 15px;
    min-height: 40px;
}

.usm-selected-products:empty::before {
    content: attr(data-placeholder);
    /* color: #9ca3af; */
    font-size: 14px;
}

.usm-product-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid;
    border-radius: 4px;
    padding: 15px;
    /* background-color: #fafafa; */
}

.usm-product-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.usm-product-item:hover {
    /* background-color: #f3f4f6; */
}

.usm-product-checkbox {
    margin-right: 10px;
    cursor: pointer;
}

.usm-product-name {
    font-size: 15px;
    /* color: #374151; */
}

/* Submit Button */
.usm-field-submit {
    margin-top: 35px;
}

.usm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    position: relative;
}

.usm-button-primary {
    /* background-color: #2563eb; */
    border: 1px solid;
    /* color: #fff; */
}

.usm-button-primary:hover {
    opacity: 0.8;
    /* background-color: #1d4ed8; */
}

.usm-button-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.usm-button.loading .usm-button-text {
    opacity: 0.5;
}

.usm-button.loading .usm-button-loader {
    display: inline-block !important;
}

/* Spinner */
.usm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: usm-spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .usm-form-container {
        padding: 20px 15px;
    }

    .usm-form-title {
        font-size: 24px;
    }

    .usm-input,
    .usm-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* .usm-form-title {
        color: #e5e7eb;
    }

    .usm-form-description,
    .usm-field-description {
        color: #9ca3af;
    }

    .usm-label {
        color: #e5e7eb;
    }

    .usm-input,
    .usm-textarea {
        background-color: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }

    .usm-product-list {
        background-color: #1f2937;
        border-color: #374151;
    }

    .usm-product-item:hover {
        background-color: #374151;
    }

    .usm-product-name {
        color: #e5e7eb;
    } */
}
