/**
 * ASN & DO Forms - Estilos (Based on PRF Professional Minimalist Design)
 * Ubicación: /wp-content/plugins/asn-do-forms/assets/css/style.css
 */

/* Global Container */
.asn-do-form-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1000px;
    margin: 30px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

/* Header */
.asn-card h2 {
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
}

.asn-card h3 {
    margin-top: 20px;
    color: #2c3e50;
    font-size: 22px;
}

/* Cards (keeping structure but removing extra padding/shadow as wrapper handles it) */
.asn-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: 20px;
}

.asn-form-group {
    margin-bottom: 16px;
}

/* Labels - Consistent styling */
.asn-do-form-wrapper label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #34495e !important;
    /* Force visibility */
    text-transform: none;
}

/* All Input Fields - Uniform Styling */
.asn-input {
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
    border: 1px solid #d1d5db !important;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff !important;
    color: #2c3e50 !important;
    transition: all 0.2s ease;
}

.asn-input::placeholder {
    color: #9ca3af;
}

.asn-input:focus {
    outline: none;
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.asn-input:disabled,
.asn-input:readonly {
    background-color: #f5f7fb !important;
    cursor: not-allowed;
}

textarea.asn-input {
    resize: vertical;
    min-height: 60px;
}

/* Select2 - Match Input Styling */
.select2-container .select2-selection--single {
    height: 45px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 43px !important;
    padding-left: 14px !important;
    color: #2c3e50 !important;
    font-size: 15px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6b7280 transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

/* Select2 Dropdown - Better Visibility */
.select2-dropdown {
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    background: #ffffff !important;
    z-index: 99999;
}

.select2-container--default .select2-results__option {
    padding: 12px 16px !important;
    font-size: 15px !important;
    background: #ffffff !important;
    color: #2c3e50 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.select2-container--default .select2-results__option:last-child {
    border-bottom: none !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #bbdefb !important;
    color: #0d47a1 !important;
    font-weight: 600 !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    background-color: #ffffff !important;
    color: #2c3e50 !important;
}

transform: translateY(-2px);
}

.asn-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.asn-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.asn-btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.25);
}

.asn-btn-success:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219150 100%);
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.35);
}

/* Alerts */
.asn-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.asn-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Table Styles */
.asn-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 24px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.asn-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.asn-table th {
    background: #f8f9fa;
    color: #2c3e50 !important;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8e8e8;
}

.asn-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #2c3e50 !important;
    /* Force black text */
    background: #ffffff;
}

.asn-table tbody tr:hover {
    background: #f9fafb;
}

.asn-table tbody tr:last-child td {
    border-bottom: none;
}

.asn-table input[type="number"],
.asn-table input[type="text"],
.asn-table select {
    padding: 8px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background: #ffffff !important;
    color: #2c3e50 !important;
}

.asn-table input:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1) !important;
}

/* Response messages */
.asn-response {
    margin-top: 20px;
    padding: 14px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.asn-response.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.asn-response.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Responsiveness - iPhone Optimized */
@media (max-width: 768px) {
    .asn-do-form-wrapper {
        margin: 16px;
        padding: 20px;
        border-radius: 12px;
    }

    .asn-card h2 {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .asn-do-form-wrapper label {
        font-size: 13px;
        margin-top: 16px;
    }

    .asn-input {
        padding: 14px 12px;
        font-size: 16px;
    }

    .select2-container .select2-selection--single {
        height: 48px !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 46px !important;
        font-size: 16px !important;
    }

    .asn-btn {
        padding: 14px 24px;
        font-size: 15px;
        margin-top: 20px;
        border-radius: 25px;
    }

    /* Stack table on mobile */
    .asn-table,
    .asn-table thead,
    .asn-table tbody,
    .asn-table th,
    .asn-table td,
    .asn-table tr {
        display: block;
    }

    .asn-table thead {
        display: none;
    }

    .asn-table tbody tr {
        margin: 0 0 16px 0;
        border: 1px solid #e8e8e8;
        border-radius: 12px;
        overflow: hidden;
        background: #ffffff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .asn-table td {
        border: none;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding: 14px 14px 14px 42%;
        min-height: 52px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .asn-table td:last-child {
        border-bottom: none;
        padding: 16px;
        justify-content: center;
        background: #f9fafb;
    }

    .asn-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-weight: 600;
        width: 38%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #34495e;
        font-size: 12px;
    }

    .asn-table td input {
        width: 100%;
        font-size: 16px !important;
        padding: 10px 12px !important;
    }
}

/* Loading state */
.asn-btn.loading {
    position: relative;
    color: transparent;
}

.asn-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: asn-spinner 0.6s linear infinite;
}

@keyframes asn-spinner {
    to {
        transform: rotate(360deg);
    }
}