/* ============================================
   Firebase Authentication Forms Styles
   ============================================ */

/* Main Container */
.wc-firebase-auth-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#recaptcha-container {
    margin-bottom: 20px;
    min-height: 1px;
    position: relative;
    z-index: 1;
}

#recaptcha-container > div {
    position: relative !important;
}

/* Tabs (for combined form) */
.firebase-auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.firebase-tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.firebase-tab:hover {
    color: #333;
}

.firebase-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

/* Form Display */
.firebase-form {
    display: none;
}

.firebase-form.active {
    display: block;
}

.firebase-form h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    color: #333;
}

/* Form Groups */
.firebase-form-group {
    margin-bottom: 20px;
}

.firebase-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.firebase-form-group input[type="tel"],
.firebase-form-group input[type="password"],
.firebase-form-group input[type="email"],
.firebase-form-group input[type="text"],
.firebase-form-group textarea,
.firebase-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.firebase-form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.firebase-form-group input:focus,
.firebase-form-group textarea:focus,
.firebase-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Phone Input */
.firebase-phone-input {
    display: flex;
    gap: 10px;
}

.country-code-select {
    flex: 0 0 150px;
    padding: 12px 10px;
}

.firebase-phone-input input[type="tel"] {
    flex: 1;
}

.firebase-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Form Rows */
.firebase-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* OTP Info */
.firebase-otp-info {
    background: #e8f5e9;
    padding: 12px 15px;
    border-radius: 4px;
    border-left: 4px solid #2e7d32;
    color: #2e7d32;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Buttons */
.firebase-form .button {
    width: 100%;
    padding: 14px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.firebase-form .button:hover {
    background: #005a87;
}

.firebase-form .button:active {
    background: #004a70;
    transform: scale(0.98);
}

.firebase-form .button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.firebase-form .button-secondary {
    background: #fff;
    color: #0073aa;
    border: 2px solid #0073aa;
    margin-top: 25px;
}

.firebase-form .button-secondary:hover {
    background: #f0f8ff;
}

/* Animations */
.register-step, .login-step {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Messages */
.firebase-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.firebase-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.firebase-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

/* Approval Pending Message */
.approval-pending-message {
    text-align: center;
    padding: 30px 20px;
}

.approval-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.approval-pending-message h3 {
    margin: 0 0 15px;
    font-size: 24px;
    color: #2e7d32;
}

.approval-pending-message p {
    margin: 10px 0;
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

.firebase-message.approval-success {
    border: 2px solid #4caf50;
    border-radius: 8px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
}

/* Form Footer Links */
.firebase-form-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.firebase-form-footer p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.firebase-form-footer a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.firebase-form-footer a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* ============================================
   Frontend Approvals Styles
   ============================================ */

.frontend-approvals-container { 
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

.approval-tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 30px; 
    border-bottom: 2px solid #e0e0e0; 
}

.approval-tab-btn { 
    padding: 15px 25px; 
    background: none; 
    border: none; 
    border-bottom: 3px solid transparent; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: 600; 
    color: #666; 
    transition: all 0.3s; 
}

.approval-tab-btn:hover { 
    color: #333; 
}

.approval-tab-btn.active { 
    color: #0073aa; 
    border-bottom-color: #0073aa; 
}

.approval-tab-content { 
    display: none; 
}

.approval-tab-content.active { 
    display: block; 
}

.approval-card { 
    background: #f9f9f9; 
    border: 1px solid #e0e0e0; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 20px; 
    transition: box-shadow 0.3s; 
}

.approval-card:hover { 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

.approval-card.approved-card { 
    background: #f1f8f4; 
    border-color: #4caf50; 
}

.approval-card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 2px solid #e0e0e0; 
}

.approval-card-name { 
    font-size: 20px; 
    font-weight: bold; 
    color: #333; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex-wrap: wrap; 
}

.firm-badge { 
    display: inline-block; 
    padding: 4px 10px; 
    background: #2196f3; 
    color: white; 
    border-radius: 4px; 
    font-size: 12px; 
    font-weight: normal; 
}

.role-badge { 
    display: inline-block; 
    padding: 4px 10px; 
    background: #666; 
    color: white; 
    border-radius: 4px; 
    font-size: 12px; 
    font-weight: normal; 
}

.role-badge.role-administrator { 
    background: #d32f2f; 
}

.role-badge.role-customer { 
    background: #4caf50; 
}

.role-badge.role-shop-manager { 
    background: #ff9800; 
}

.approval-card-date { 
    font-size: 12px; 
    color: #999; 
    white-space: nowrap; 
}

.approval-card-details { 
    margin-bottom: 20px; 
}

.approval-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.approval-detail-row:last-child {
    border-bottom: none;
}

.approval-detail.full-width {
    grid-column: 1 / -1;
}

.approval-detail { 
    font-size: 14px; 
    padding: 8px 0; 
}

.approval-detail-label { 
    display: block;
    font-size: 12px;
    font-weight: 600; 
    color: #666; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.approval-detail-value { 
    display: block;
    font-size: 15px;
    color: #333; 
    font-weight: 500;
}

.approval-actions { 
    display: flex; 
    gap: 10px; 
    padding-top: 15px; 
    border-top: 2px solid #e0e0e0; 
    align-items: center; 
    flex-wrap: wrap; 
}

.approval-role-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex: 1; 
    min-width: 250px; 
}

.approval-role-wrapper label { 
    font-weight: 600; 
    font-size: 14px; 
    color: #333; 
    white-space: nowrap; 
}

.approval-role-select { 
    padding: 10px 15px; 
    border: 2px solid #ddd; 
    border-radius: 4px; 
    flex: 1; 
    font-size: 14px; 
    font-weight: 600; 
    background: white; 
    cursor: pointer; 
    transition: border-color 0.3s; 
}

.approval-role-select:focus { 
    outline: none; 
    border-color: #0073aa; 
}

.btn-approve { 
    padding: 12px 24px; 
    background: #4caf50; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 14px; 
    transition: all 0.3s; 
    white-space: nowrap; 
}

.btn-approve:hover { 
    background: #45a049; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3); 
}

.btn-delete { 
    padding: 12px 24px; 
    background: #f44336; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 14px; 
    transition: all 0.3s; 
    white-space: nowrap; 
}

.btn-delete:hover { 
    background: #da190b; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3); 
}

.empty-state { 
    text-align: center; 
    padding: 60px 20px; 
    color: #999; 
}

.empty-state-icon { 
    font-size: 64px; 
    margin-bottom: 20px; 
}

.empty-state h3 { 
    color: #666; 
    margin-bottom: 10px; 
}

.empty-state p { 
    color: #999; 
}

.approval-card.removing {
    opacity: 0.5;
    pointer-events: none;
}

.btn-approve:disabled,
.btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.approval-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.approval-message.success {
    background: #4caf50;
    color: white;
}

.approval-message.error {
    background: #f44336;
    color: white;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .approval-card-header { 
        flex-direction: column; 
        gap: 10px; 
    }
    
    .approval-card-name { 
        font-size: 18px; 
    }
    
    .approval-detail-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .approval-actions { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .approval-role-wrapper { 
        width: 100%; 
        min-width: auto; 
    }
    
    .btn-approve, 
    .btn-delete { 
        width: 100%; 
    }
}

@media (max-width: 600px) {
    .wc-firebase-auth-container {
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
    }
    
    .firebase-form h2 {
        font-size: 20px;
    }
    
    .firebase-tab {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .firebase-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .firebase-form .button {
        min-height: 48px;
        font-size: 17px;
    }
    
    .firebase-form-group input,
    .firebase-form-group select,
    .firebase-form-group textarea {
        font-size: 16px;
    }
}

.firebase-form .button-secondary.max-attempts-reached {
    background: #999 !important;
    color: #fff !important;
    border-color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.firebase-form .button-secondary:disabled {
    background: #f0f0f0;
    color: #999;
    border-color: #ddd;
}