/**
 * BFM Shortcodes - Stili Comuni
 * 
 * @package BalloonFlightManager
 */

/* ==========================================================================
   Variables (CSS Custom Properties)
   ========================================================================== */
:root {
    --bfm-primary: #FF5722;
    --bfm-primary-dark: #E64A19;
    --bfm-secondary: #667eea;
    --bfm-secondary-dark: #5a67d8;
    --bfm-success: #4CAF50;
    --bfm-warning: #FF9800;
    --bfm-danger: #f44336;
    --bfm-info: #2196F3;
    
    --bfm-text: #333;
    --bfm-text-light: #666;
    --bfm-text-muted: #999;
    
    --bfm-bg: #fff;
    --bfm-bg-light: #f5f5f5;
    --bfm-bg-dark: #f0f0f1;
    
    --bfm-border: #ddd;
    --bfm-border-light: #e0e0e0;
    
    --bfm-radius: 8px;
    --bfm-radius-lg: 12px;
    
    --bfm-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --bfm-shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    
    --bfm-transition: 0.3s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
.bfm-section-title {
    color: var(--bfm-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bfm-title-icon {
    font-size: 1.2em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.bfm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--bfm-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--bfm-transition);
    text-decoration: none;
    white-space: nowrap;
}

.bfm-button:hover {
    transform: translateY(-1px);
}

.bfm-button-primary {
    background: var(--bfm-secondary);
    color: #fff;
}

.bfm-button-primary:hover {
    background: var(--bfm-secondary-dark);
}

.bfm-button-secondary {
    background: var(--bfm-bg-light);
    color: var(--bfm-text);
    border: 1px solid var(--bfm-border);
}

.bfm-button-secondary:hover {
    background: var(--bfm-bg-dark);
}

.bfm-button-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.bfm-input,
.bfm-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bfm-border);
    border-radius: var(--bfm-radius);
    font-size: 14px;
    background: var(--bfm-bg);
    transition: border-color var(--bfm-transition);
}

.bfm-input:focus,
.bfm-select:focus {
    outline: none;
    border-color: var(--bfm-secondary);
}

.bfm-filter-group {
    flex: 1;
    min-width: 180px;
}

.bfm-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--bfm-text);
    font-size: 14px;
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */
.bfm-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.bfm-toggle input {
    cursor: pointer;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.bfm-card {
    background: var(--bfm-bg);
    border: 1px solid var(--bfm-border);
    border-radius: var(--bfm-radius);
    padding: 20px;
    box-shadow: var(--bfm-shadow);
    transition: all var(--bfm-transition);
}

.bfm-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bfm-shadow-lg);
}

/* ==========================================================================
   Messages & States
   ========================================================================== */
.bfm-login-required,
.bfm-error-message,
.bfm-warning-message,
.bfm-empty-state {
    background: var(--bfm-bg);
    padding: 50px;
    text-align: center;
    border-radius: var(--bfm-radius-lg);
    box-shadow: var(--bfm-shadow);
}

.bfm-login-required {
    border: 1px solid var(--bfm-border);
}

.bfm-error-message {
    border: 1px solid var(--bfm-danger);
    background: #fff5f5;
}

.bfm-warning-message {
    border: 1px solid var(--bfm-warning);
    background: #fff8e1;
}

.bfm-empty-state {
    border: 1px solid var(--bfm-border);
    background: var(--bfm-bg-light);
}

.bfm-login-icon,
.bfm-error-icon,
.bfm-warning-icon,
.bfm-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.bfm-login-required h2,
.bfm-error-message h2,
.bfm-warning-message h2 {
    margin: 0 0 15px 0;
}

.bfm-login-required p,
.bfm-error-message p,
.bfm-warning-message p,
.bfm-empty-state p {
    color: var(--bfm-text-light);
    margin-bottom: 15px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.bfm-loading {
    text-align: center;
    padding: 40px;
    color: var(--bfm-text-light);
}

.bfm-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bfm-border);
    border-top-color: var(--bfm-secondary);
    border-radius: 50%;
    animation: bfm-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes bfm-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Map Styles
   ========================================================================== */
.bfm-map-wrapper {
    position: relative;
    margin: 20px 0;
}

.bfm-map,
.bfm-live-map,
.bfm-history-map,
.bfm-dashboard-map {
    border-radius: var(--bfm-radius);
    overflow: hidden;
    width: 100%;
}

.bfm-map-instruction {
    background: #fff3cd;
    padding: 10px 15px;
    border-radius: var(--bfm-radius);
    margin-top: 10px;
    text-align: center;
    border: 1px solid #ffc107;
}

.bfm-map-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
    padding: 10px;
    background: var(--bfm-bg-light);
    border-radius: var(--bfm-radius);
}

.bfm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.bfm-legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.bfm-legend-takeoff {
    background: var(--bfm-success);
}

.bfm-legend-landing {
    background: var(--bfm-danger);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.bfm-lightbox {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.bfm-lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.bfm-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.bfm-lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.bfm-lightbox-close:hover {
    color: var(--bfm-warning);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .bfm-section-title {
        font-size: 1.25rem;
    }
    
    .bfm-filter-group {
        min-width: 100%;
    }
    
    .bfm-login-required,
    .bfm-error-message,
    .bfm-warning-message,
    .bfm-empty-state {
        padding: 30px 20px;
    }
    
    .bfm-login-icon,
    .bfm-error-icon,
    .bfm-warning-icon,
    .bfm-empty-icon {
        font-size: 48px;
    }
}
