/**
 * Babel Portal - Additional Styles
 * 
 * Supplementary styles for specific portal components
 * Main styles are in parent style.css
 * 
 * @package Neve_Babel_Child
 * @version 1.0.0
 */

/* ==========================================================================
   1. ENHANCED FORM COMPONENTS
   ========================================================================== */

/* Radio/Checkbox Groups */
.babel-document-type-option input[type="radio"]:checked + .babel-type-card {
    border-color: var(--babel-primary, #0066cc);
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
    transform: translateY(-2px);
}

.babel-document-type-option input[type="radio"]:focus + .babel-type-card {
    outline: 2px solid var(--babel-primary, #0066cc);
    outline-offset: 2px;
}

/* File Upload Enhanced */
.babel-file-upload-area.drag-over {
    border-color: var(--babel-primary, #0066cc);
    background: rgba(0, 102, 204, 0.05);
    transform: scale(1.02);
}

.babel-file-upload-area.drag-over .babel-upload-icon {
    animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.babel-file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--babel-radius-md, 8px);
    margin-top: 1rem;
}

.babel-file-name {
    flex: 1;
    font-weight: 500;
    color: var(--babel-text-primary, #333);
}

.babel-file-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.babel-file-remove:hover {
    background: #c82333;
    transform: rotate(90deg);
}

/* Form Validation States */
.babel-form-group.has-error input,
.babel-form-group.has-error select,
.babel-form-group.has-error textarea {
    border-color: var(--babel-error, #dc3545);
    background: #fff5f5;
}

.babel-form-group.has-success input,
.babel-form-group.has-success select {
    border-color: var(--babel-success, #28a745);
    background: #f0fff4;
}

.babel-form-group .error-message {
    display: block;
    margin-top: 0.5rem;
    color: var(--babel-error, #dc3545);
    font-size: 0.875rem;
}

.babel-form-group .success-message {
    display: block;
    margin-top: 0.5rem;
    color: var(--babel-success, #28a745);
    font-size: 0.875rem;
}

/* ==========================================================================
   2. DASHBOARD ENHANCEMENTS
   ========================================================================== */

/* Stat Cards Animations */
.babel-stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.babel-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.babel-stat-icon {
    animation: fadeInScale 0.6s ease backwards;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dashboard Grid Animation */
.babel-stats-grid .babel-stat-card:nth-child(1) { animation-delay: 0.1s; }
.babel-stats-grid .babel-stat-card:nth-child(2) { animation-delay: 0.2s; }
.babel-stats-grid .babel-stat-card:nth-child(3) { animation-delay: 0.3s; }
.babel-stats-grid .babel-stat-card:nth-child(4) { animation-delay: 0.4s; }
.babel-stats-grid .babel-stat-card:nth-child(5) { animation-delay: 0.5s; }

/* Table Row Hover Effects */
.babel-orders-table tbody tr {
    transition: all 0.2s ease;
}

.babel-orders-table tbody tr:hover {
    background: rgba(0, 102, 204, 0.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Action Buttons Enhanced */
.babel-actions button {
    transition: all 0.2s ease;
}

.babel-actions button:hover {
    transform: scale(1.1);
}

.babel-actions button:active {
    transform: scale(0.95);
}

/* ==========================================================================
   3. MODALS
   ========================================================================== */

.babel-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.babel-modal-content {
    position: relative;
    background: white;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border-radius: var(--babel-radius-lg, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
}

.babel-modal-content.babel-modal-large {
    max-width: 900px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.babel-modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.babel-modal-close:hover {
    color: #333;
    background: #f0f0f0;
    transform: rotate(90deg);
}

/* ==========================================================================
   4. LANGUAGE SWITCHER ENHANCEMENTS
   ========================================================================== */

.babel-language-switcher .babel-flag {
    width: 20px;
    height: 15px;
    display: inline-block;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.babel-language-switcher .babel-flag.flag-sq {
    background: linear-gradient(to bottom, #e41e20 0%, #e41e20 100%);
}

.babel-language-switcher .babel-flag.flag-de {
    background: linear-gradient(to bottom, #000 33.33%, #dd0000 33.33%, #dd0000 66.66%, #ffce00 66.66%);
}

.babel-language-switcher .babel-flag.flag-en {
    background: 
        linear-gradient(to bottom, #012169 0%, #012169 100%),
        repeating-linear-gradient(0deg, transparent, transparent 10px, white 10px, white 20px);
}

.babel-dropdown-content a:hover .babel-flag {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

/* ==========================================================================
   5. PRICING CALCULATOR
   ========================================================================== */

.babel-pricing-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--babel-border, #dee2e6);
}

.babel-price-breakdown {
    background: white;
    padding: 1.5rem;
    border-radius: var(--babel-radius-md, 8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.babel-price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.babel-price-row:last-child {
    border-bottom: none;
}

.babel-price-row.babel-total {
    border-top: 2px solid var(--babel-primary, #0066cc);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.25rem;
}

.babel-price-row.babel-total strong {
    color: var(--babel-primary, #0066cc);
}

.babel-price-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

/* ==========================================================================
   6. PROGRESS INDICATORS
   ========================================================================== */

.babel-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.babel-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--babel-primary, #0066cc), var(--babel-secondary, #00a8e8));
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.babel-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================================================
   7. TOAST NOTIFICATIONS
   ========================================================================== */

.babel-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--babel-radius-md, 8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.babel-toast.babel-toast-success {
    border-left: 4px solid var(--babel-success, #28a745);
}

.babel-toast.babel-toast-error {
    border-left: 4px solid var(--babel-error, #dc3545);
}

.babel-toast.babel-toast-warning {
    border-left: 4px solid var(--babel-warning, #ffc107);
}

.babel-toast.babel-toast-info {
    border-left: 4px solid var(--babel-info, #17a2b8);
}

.babel-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.babel-toast-content {
    flex: 1;
}

.babel-toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.babel-toast-message {
    font-size: 0.875rem;
    color: #6c757d;
}

.babel-toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.babel-toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ==========================================================================
   8. LOADING STATES
   ========================================================================== */

.babel-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.babel-skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.babel-skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.babel-skeleton-card {
    height: 100px;
    border-radius: var(--babel-radius-md, 8px);
}

/* Button Loading State */
button.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

button.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* ==========================================================================
   9. ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

.babel-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.babel-focus-visible:focus-visible {
    outline: 2px solid var(--babel-primary, #0066cc);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .babel-status-badge {
        border: 2px solid currentColor;
    }
    
    .babel-button {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   10. PRINT STYLES
   ========================================================================== */

@media print {
    .babel-language-switcher,
    .babel-actions,
    .babel-form-actions,
    .babel-admin-filters,
    .babel-bulk-actions,
    .babel-modal,
    .babel-toast {
        display: none !important;
    }
    
    .babel-orders-table {
        border: 1px solid #000;
    }
    
    .babel-status-badge {
        border: 1px solid #000;
        color: #000;
    }
    
    .babel-stat-card {
        break-inside: avoid;
    }
}
