/**
 * User Profile Form Styles (Phase 2)
 * Enhanced styling for CF7 common fields form
 * 
 * @package Eduma-Child
 * @version 1.0.0
 * @author Agung Januar
 */

/* Form Wrapper */
.user-profile-form-wrapper {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Profile Header */
.learn-press-profile-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.learn-press-profile-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.learn-press-profile-header .description {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.profile-status-bar {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.status-complete {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-badge.status-incomplete {
    background-color: #fff3cd;
    color: #856404;
}

/* Form Sections */
.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
}

.form-section .section-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section .section-title i {
    color: #4a90e2;
}

.form-section .section-title .optional {
    font-size: 12px;
    font-weight: normal;
    color: #999;
    font-style: italic;
}

/* Form Rows */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-field {
    margin-bottom: 20px;
    padding: 0 10px;
    width: 100%;
}

.form-field.col-md-6 {
    width: 50%;
}

.form-field.col-md-12 {
    width: 100%;
}

@media (max-width: 768px) {
    .form-field.col-md-6 {
        width: 100%;
    }
}

/* Form Labels */
.form-field label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-field label .required {
    color: #dc3545;
    margin-left: 3px;
}

.form-field label .optional {
    color: #999;
    font-weight: normal;
    font-size: 12px;
    font-style: italic;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-control[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

/* Input Group (for Instagram @) */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-group-text {
    padding: 10px 12px;
    background-color: #e9ecef;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 5px 0 0 5px;
    color: #495057;
    font-weight: 600;
}

.input-group .form-control {
    border-radius: 0 5px 5px 0;
}

/* File Input */
.form-control-file {
    display: block;
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
}

.form-control-file::-webkit-file-upload-button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s;
}

.form-control-file::-webkit-file-upload-button:hover {
    background-color: #e9ecef;
}

/* Form Text (Helper Text) */
.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

/* Current File Display */
.current-file {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.current-file img {
    display: block;
    max-width: 150px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.current-file p {
    margin: 10px 0 0 0;
}

.current-file a {
    color: #4a90e2;
    text-decoration: none;
    font-size: 13px;
}

.current-file a:hover {
    text-decoration: underline;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.form-actions .lp-button {
    padding: 12px 40px;
    background-color: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.form-actions .lp-button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

.form-actions .lp-button:active {
    transform: translateY(0);
}

.form-actions .lp-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.form-actions .btn-loading {
    display: none;
}

.form-actions .lp-button.loading .btn-text {
    display: none;
}

.form-actions .lp-button.loading .btn-loading {
    display: inline;
}

.form-note {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form-note i {
    color: #4a90e2;
}

/* Form Messages */
.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    font-size: 14px;
}

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

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

.form-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Validation States */
.form-field.has-error .form-control {
    border-color: #dc3545;
}

.form-field.has-error .error-message {
    display: block;
    margin-top: 5px;
    color: #dc3545;
    font-size: 12px;
}

.form-field .error-message {
    display: none;
}

/* Loading Overlay */
.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.form-loading-overlay.active {
    display: flex;
}

.form-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .user-profile-form-wrapper {
        padding: 20px 15px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .learn-press-profile-header h3 {
        font-size: 20px;
    }
    
    .form-section .section-title {
        font-size: 16px;
    }
    
    .form-actions .lp-button {
        width: 100%;
        padding: 15px;
    }
    
    .profile-status-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Print Styles */
@media print {
    .form-actions {
        display: none;
    }
    
    .user-profile-form-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Additional LearnPress Form Fields (Phase 3) */
/* For 3-column layout (phone inputs) */
.form-fields li.form-field__33 {
    width: calc(33.333% - 15px);
    float: left;
    margin-right: 22px;
    margin-bottom: 20px;
}

.form-fields li.form-field__33:nth-child(3n) {
    margin-right: 0;
}

/* Responsive adjustments for 3-column layout */
@media (max-width: 768px) {
    .form-fields li.form-field__33 {
        width: 100%;
        float: none;
        margin-right: 0;
    }
}

/* Tab Content Visibility (Phase 3) */
#profile-content-user-profile .learn-press-tabs__content {
    display: none;
}

#profile-content-user-profile .learn-press-tabs__content.active {
    display: block;
}

/* Smooth transition for tab switching */
#profile-content-user-profile .learn-press-tabs__content.active {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   CONSISTENT HEIGHT FOR ALL INPUTS
   =================================== */

/* Base styling for all text inputs, selects, and textareas */
.learn-press-form input[type="text"],
.learn-press-form input[type="email"],
.learn-press-form input[type="number"],
.learn-press-form input[type="date"],
.learn-press-form input[type="tel"],
.learn-press-form input[type="url"],
.learn-press-form select,
.learn-press-form .regular-text {
    height: 44px !important;
    width: 100%;
    padding: 10px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Textarea specific height */
.learn-press-form textarea,
.learn-press-form textarea.regular-text {
    height: auto !important;
    min-height: 80px !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Focus state */
.learn-press-form input[type="text"]:focus,
.learn-press-form input[type="email"]:focus,
.learn-press-form input[type="number"]:focus,
.learn-press-form input[type="date"]:focus,
.learn-press-form input[type="tel"]:focus,
.learn-press-form input[type="url"]:focus,
.learn-press-form select:focus,
.learn-press-form textarea:focus,
.learn-press-form .regular-text:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
    outline: none !important;
}

/* Select specific adjustments */
.learn-press-form 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 12px center;
    padding-right: 35px !important;
    cursor: pointer;
}

/* File input consistency */
.learn-press-form input[type="file"] {
    padding: 8px 0 !important;
    border: none !important;
    height: auto !important;
}

/* Description text below inputs */
.learn-press-form .description {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Radio and checkbox inputs (don't apply height) */
.learn-press-form input[type="radio"],
.learn-press-form input[type="checkbox"] {
    padding: 0 !important;
    margin-right: 5px;
}

.no-margins {
    margin: 0 !important;
}