/* ========================================
   edit-post-styles.css
   Stili per modifica segnalazione
   Identico a create-styles.css
   ======================================== */

/* ===== VARIABLES ===== */
:root {
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --gradient-light: rgba(14, 165, 233, 0.08);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --surface: #ffffff;
    --surface-light: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --background: #f1f5f9;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== FORM PRINCIPALE ===== */
.create-form {
    background: var(--surface);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-bottom: 40px;
}

/* ===== TITOLO CON GRADIENTE ===== */
.form-title {
    text-align: center;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    margin-bottom: 16px;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.form-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1.1rem;
    padding: 16px 20px;
    background: var(--gradient-light);
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    line-height: 1.5;
}

/* ===== LAYOUT GRID ===== */
.form-grid {
    display: grid;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ===== LABELS ===== */
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--primary-color);
    font-weight: 700;
}

/* ===== INPUTS ===== */
.form-input,
.form-select,
.form-textarea {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface);
    font-family: inherit;
    color: var(--text-primary);
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ===== HELPER TEXT ===== */
.helper-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== CONTACT INFO HINT ===== */
.contact-info-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    line-height: 1.4;
}

.contact-info-hint strong {
    color: #10b981;
}

/* ===== MAPPA ===== */
.map-instructions {
    background: rgba(14, 165, 233, 0.06);
    border: 2px solid rgba(14, 165, 233, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.map-instructions strong {
    color: var(--primary-color);
    font-weight: 600;
}

#map {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.leaflet-control-container .leaflet-top {
    top: 10px;
}

.leaflet-control-container .leaflet-bottom {
    bottom: 10px;
}

/* ===== BUTTONS ===== */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
}

.btn-secondary:active {
    background: rgba(14, 165, 233, 0.1);
}

.btn-location {
    width: 100%;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-location:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* ===== MESSAGES ===== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: 16px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.error-message::before {
    content: '⚠️';
    flex-shrink: 0;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-top: 16px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.success-message::before {
    content: '✅';
    flex-shrink: 0;
}

/* ===== LOADING STATES ===== */
.btn-primary:disabled::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* ===== ANIMATIONS ===== */
@keyframes formSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.create-form {
    animation: formSlideUp 0.5s ease;
}

.contact-info-hint {
    animation: fadeIn 0.6s ease 0.2s both;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .create-form {
        padding: 24px;
    }
    
    .form-title {
        font-size: 1.6rem;
    }
    
    .form-subtitle {
        font-size: 1rem;
        padding: 12px 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    #map {
        height: 300px !important;
    }
    
    .map-instructions {
        font-size: 0.85rem;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .create-form {
        padding: 20px;
    }
    
    .form-title {
        font-size: 1.4rem;
    }
    
    .form-subtitle {
        font-size: 0.95rem;
        padding: 12px 16px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .contact-info-hint {
        font-size: 0.8rem;
        padding: 10px;
    }
    
    #map {
        height: 250px !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .create-form,
    .contact-info-hint {
        animation: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-location:hover {
        transform: none;
    }
}

.btn-primary:focus,
.btn-secondary:focus,
.btn-location:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ===== CROPPER CUSTOMIZATION ===== */
.cropper-view-box {
    border: 2px solid var(--primary-color) !important;
    border-radius: 8px !important;
}

.cropper-face {
    background-color: rgba(14, 165, 233, 0.1) !important;
}

.cropper-line {
    background-color: var(--primary-color) !important;
    opacity: 0.8 !important;
}

.cropper-point {
    background-color: var(--primary-color) !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
