/**
 * TCF Report System - Modern UI Styles
 * Professional design for floating report button and modal
 * @since 2.1.0
 */

/* ========================================
   Floating Report Button
   ======================================== */
.tcf-floating-report-btn {
    all: initial;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px !important;
    height: 60px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 60px !important;
    max-height: 60px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1 !important;
    box-sizing: border-box !important;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-border 2s infinite;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit;
}

.tcf-floating-report-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.tcf-floating-report-btn:active {
    transform: scale(0.95);
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4), 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4), 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .tcf-floating-report-btn {
        bottom: 80px; /* Above bottom navigation */
        right: 16px;
        width: 56px !important;
        height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
        font-size: 22px;
    }
}

/* ========================================
   Report Modal
   ======================================== */
.tcf-report-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tcf-report-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcf-report-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.tcf-report-modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 24px 28px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tcf-report-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    color: white !important;
}

.tcf-report-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.tcf-report-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.tcf-report-modal-body {
    padding: 28px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Custom Scrollbar */
.tcf-report-modal-body::-webkit-scrollbar {
    width: 8px;
}

.tcf-report-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tcf-report-modal-body::-webkit-scrollbar-thumb {
    background: #dc3545;
    border-radius: 10px;
}

.tcf-report-modal-body::-webkit-scrollbar-thumb:hover {
    background: #c82333;
}

/* Info Box */
.tcf-report-info-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #dc3545;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    direction: ltr !important;
}

.tcf-report-info-box .info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
    direction: ltr !important;
    text-align: left !important;
}

.tcf-report-info-box .info-row span {
    direction: ltr !important;
    text-align: left !important;
    display: inline-block !important;
    unicode-bidi: embed !important;
    width: 100% !important;
}

.tcf-report-info-box .info-row strong {
    direction: ltr !important;
    unicode-bidi: embed !important;
}

.tcf-report-info-box .info-row #report-test-name,
.tcf-report-info-box .info-row #report-test-url {
    direction: ltr !important;
    unicode-bidi: embed !important;
}

.tcf-report-info-box .info-row:last-child {
    margin-bottom: 0;
}

.tcf-report-info-box .info-row i {
    color: #dc3545;
    margin-top: 2px;
    flex-shrink: 0;
}

.tcf-report-info-box a {
    color: #0056d2;
    text-decoration: none;
    word-break: break-all;
    direction: ltr !important;
    unicode-bidi: embed !important;
}

.tcf-report-info-box a:hover {
    text-decoration: underline;
}

/* Form Groups */
.tcf-form-group {
    margin-bottom: 20px;
}

.tcf-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #212529;
    font-size: 14px;
}

.tcf-form-group .required {
    color: #dc3545;
    font-weight: bold;
}

.tcf-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.tcf-form-control:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.tcf-form-control::placeholder {
    color: #adb5bd;
}

textarea.tcf-form-control {
    resize: vertical;
    min-height: 120px;
}

.tcf-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

/* Form Actions */
.tcf-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.tcf-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 140px;
}

.tcf-btn-primary {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.tcf-btn-primary:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.tcf-btn-primary:active {
    transform: translateY(0);
}

.tcf-btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.tcf-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.tcf-btn-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* Status Messages */
.tcf-report-status {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tcf-report-status.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.tcf-report-status.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.tcf-report-status i {
    font-size: 18px;
}

/* Loading State */
.tcf-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.tcf-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .tcf-report-modal {
        padding: 0;
    }

    .tcf-report-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        min-height: 100vh;
    }

    .tcf-report-modal-header {
        border-radius: 0;
        padding: 20px;
    }

    .tcf-report-modal-header h3 {
        font-size: 18px;
    }

    .tcf-report-modal-body {
        padding: 20px;
        max-height: calc(100vh - 80px);
    }

    .tcf-form-actions {
        flex-direction: column;
    }

    .tcf-btn {
        width: 100%;
        min-width: auto;
    }

    .tcf-report-info-box {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tcf-report-modal-body {
        padding: 16px;
    }

    .tcf-form-control {
        padding: 10px 14px;
        font-size: 14px;
    }

    .tcf-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.tcf-floating-report-btn:focus,
.tcf-report-close:focus,
.tcf-btn:focus,
.tcf-form-control:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tcf-report-modal {
        background-color: rgba(0, 0, 0, 0.9);
    }

    .tcf-form-control {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .tcf-floating-report-btn {
        animation: none;
    }
}
