/**
 * AirAzona FPV Location Intelligence System - CSS Styles
 * Enhanced location details with AI features and user feedback
 *
 * Components:
 * - Enhanced location modals
 * - Quality scoring visualization
 * - AI enhancement features
 * - User feedback system
 * - Notifications and loading states
 * - Form validation and interactions
 */

/* ========================================
   Enhanced Location Modals
   ======================================== */

.enhanced-modal {
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.enhanced-modal.show {
    opacity: 1;
}

.enhanced-location-modal {
    position: relative;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.enhanced-modal.show .enhanced-location-modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px 30px 20px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e4080 100%);
    color: white;
    position: relative;
}

.location-title-section {
    flex: 1;
}

.location-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.location-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.location-category,
.location-difficulty {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-category.legal_flying { background: rgba(40, 167, 69, 0.9); }
.location-category.restricted { background: rgba(255, 193, 7, 0.9); color: #333; }
.location-category.prohibited { background: rgba(220, 53, 69, 0.9); }
.location-category.seasonal { background: rgba(23, 162, 184, 0.9); }

.location-difficulty.easy { background: rgba(40, 167, 69, 0.8); }
.location-difficulty.moderate { background: rgba(255, 193, 7, 0.8); color: #333; }
.location-difficulty.difficult { background: rgba(220, 53, 69, 0.8); }

.modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.location-meta-footer {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* ========================================
   Quality Score Section
   ======================================== */

.quality-score-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.quality-score-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quality-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.quality-score-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c5aa0;
}

.quality-score-display {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.quality-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-weight: 700;
    color: white;
    background: conic-gradient(from 0deg, var(--quality-color) calc(var(--quality-percent) * 1%), #e9ecef calc(var(--quality-percent) * 1%));
    flex-shrink: 0;
}

.quality-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: white;
}

.quality-number {
    position: relative;
    z-index: 1;
    font-size: 32px;
    color: #333;
}

.quality-percent {
    position: relative;
    z-index: 1;
    font-size: 14px;
    color: #666;
    margin-top: -5px;
}

.quality-circle.excellent {
    --quality-color: #28a745;
    --quality-percent: var(--score);
}

.quality-circle.good {
    --quality-color: #007bff;
    --quality-percent: var(--score);
}

.quality-circle.fair {
    --quality-color: #ffc107;
    --quality-percent: var(--score);
}

.quality-circle.needs_improvement {
    --quality-color: #fd7e14;
    --quality-percent: var(--score);
}

.quality-breakdown {
    flex: 1;
    min-width: 200px;
}

.quality-status {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
}

.quality-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quality-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.quality-label {
    font-weight: 500;
    color: #666;
}

.quality-value {
    font-weight: 600;
    color: #2c5aa0;
}

/* ========================================
   AI Enhancement Buttons
   ======================================== */

.btn-ai {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #7952cc 0%, #63339c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.3);
}

.btn-ai:active {
    transform: translateY(0);
}

.btn-ai-disabled {
    background: #6c757d;
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Location Details Grid
   ======================================== */

.location-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.details-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c5aa0;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.detail-section p {
    margin: 0;
    line-height: 1.6;
    color: #495057;
}

.hazards-section {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.hazards-section h4 {
    color: #dc3545;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    font-weight: 600;
    color: #333;
    text-align: right;
}

/* ========================================
   Enhancement Opportunities
   ======================================== */

.enhancement-opportunities {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.enhancement-opportunities h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c5aa0;
}

.opportunities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.opportunity-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #6c757d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.opportunity-card.high {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.opportunity-card.medium {
    border-left-color: #ffc107;
    background: #fffdf5;
}

.opportunity-card.low {
    border-left-color: #28a745;
    background: #f8fff9;
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.opportunity-type {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.opportunity-priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.opportunity-card.high .opportunity-priority {
    background: #dc3545;
    color: white;
}

.opportunity-card.medium .opportunity-priority {
    background: #ffc107;
    color: #333;
}

.opportunity-card.low .opportunity-priority {
    background: #28a745;
    color: white;
}

.opportunity-message {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* ========================================
   Feedback Section
   ======================================== */

.feedback-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 25px;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.feedback-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c5aa0;
}

.feedback-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.feedback-count,
.no-feedback {
    color: #6c757d;
    font-size: 14px;
}

.feedback-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-value {
    font-weight: 600;
    color: #495057;
}

.feedback-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border: 2px solid #2c5aa0;
    color: #2c5aa0;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-outline:hover {
    background: #2c5aa0;
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   Feedback Modal
   ======================================== */

.feedback-modal-overlay {
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-modal-overlay.show {
    opacity: 1;
}

.feedback-modal {
    max-width: 600px;
    width: 95%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(-30px) scale(0.9);
    transition: transform 0.3s ease;
}

.feedback-modal-overlay.show .feedback-modal {
    transform: translateY(0) scale(1);
}

.feedback-modal-header {
    background: #2c5aa0;
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.feedback-form {
    padding: 30px 25px 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-group textarea,
.form-group input[type="email"] {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input[type="email"]:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-group textarea.error,
.form-group input.error {
    border-color: #dc3545;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
}

.rating-input {
    display: flex;
    gap: 5px;
    align-items: center;
}

.rating-input input[type="radio"] {
    display: none;
}

.star-label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rating-input input[type="radio"]:checked ~ .star-label,
.rating-input input[type="radio"]:checked + .star-label {
    color: #ffc107;
}

.rating-input .star-label:hover {
    color: #ffc107;
}

.form-help {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #2c5aa0;
    color: white;
}

.btn-primary:hover {
    background: #1e4080;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-form-status {
    margin-top: 15px;
    border-radius: 6px;
    padding: 0;
    transition: all 0.3s ease;
}

.form-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* ========================================
   Notifications
   ======================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #2c5aa0;
    z-index: 10002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-success {
    border-left-color: #28a745;
}

.notification-error {
    border-left-color: #dc3545;
}

.notification-info {
    border-left-color: #17a2b8;
}

.notification i {
    font-size: 18px;
}

.notification-success i { color: #28a745; }
.notification-error i { color: #dc3545; }
.notification-info i { color: #17a2b8; }

/* ========================================
   Loading States
   ======================================== */

.loading-modal {
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #2c5aa0;
}

.loading-spinner p {
    font-size: 16px;
    margin: 0;
}

.error-modal {
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
}

.error-modal-content {
    max-width: 400px;
    width: 90%;
    background: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
}

.error-modal-content h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
    font-size: 20px;
}

.error-modal-content p {
    margin: 0 0 25px 0;
    color: #666;
    line-height: 1.5;
}

/* ========================================
   Tooltips
   ======================================== */

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10003;
    pointer-events: none;
    transform: translateX(-50%);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .enhanced-location-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .modal-close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        margin: 0;
    }

    .location-title {
        font-size: 24px;
        padding-right: 50px;
    }

    .modal-body {
        padding: 20px;
        max-height: calc(100vh - 180px);
    }

    .quality-score-section {
        padding: 20px;
    }

    .quality-score-display {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .location-details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-section {
        padding: 15px;
    }

    .opportunities-grid {
        grid-template-columns: 1fr;
    }

    .feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .feedback-actions {
        width: 100%;
        justify-content: center;
    }

    .btn-outline {
        flex: 1;
        justify-content: center;
    }

    .feedback-modal {
        width: 100%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
        transform: translateY(-100%);
    }

    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .quality-circle {
        width: 100px;
        height: 100px;
    }

    .quality-number {
        font-size: 28px;
    }

    .location-title {
        font-size: 20px;
    }

    .modal-body {
        padding: 15px;
    }

    .quality-score-section,
    .detail-section,
    .enhancement-opportunities,
    .feedback-section {
        padding: 15px;
    }

    .feedback-form {
        padding: 20px 15px;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .enhanced-location-modal {
        background: #2d3748;
        color: #e2e8f0;
    }

    .detail-section {
        background: #4a5568;
        border-color: #718096;
    }

    .quality-score-section {
        background: #4a5568;
        border-color: #718096;
    }

    .enhancement-opportunities {
        background: #4a5568;
        border-color: #718096;
    }

    .feedback-section {
        background: #4a5568;
        border-color: #718096;
    }

    .form-group textarea,
    .form-group input[type="email"] {
        background: #2d3748;
        border-color: #718096;
        color: #e2e8f0;
    }

    .notification {
        background: #2d3748;
        color: #e2e8f0;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .enhanced-modal {
        position: static !important;
        background: none !important;
    }

    .enhanced-location-modal {
        box-shadow: none !important;
        max-height: none !important;
        width: 100% !important;
        max-width: none !important;
    }

    .modal-header {
        background: none !important;
        color: #333 !important;
    }

    .btn,
    .feedback-actions,
    .quality-actions,
    .modal-close-btn {
        display: none !important;
    }

    .modal-body {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ========================================
   Accessibility Improvements
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .enhanced-modal,
    .enhanced-location-modal,
    .feedback-modal,
    .notification {
        transition: none !important;
    }

    .btn,
    .btn-outline,
    .btn-ai {
        transition: none !important;
    }

    .loading-spinner i {
        animation: none !important;
    }
}

/* Focus indicators */
.modal-close-btn:focus,
.btn:focus,
.btn-outline:focus,
.btn-ai:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.form-group textarea:focus,
.form-group input:focus {
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.3) !important;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .enhanced-location-modal {
        border: 2px solid #000;
    }

    .btn,
    .btn-outline,
    .btn-ai {
        border: 2px solid currentColor;
    }

    .quality-circle {
        border: 2px solid #000;
    }
}
