/* plans.css - Stili specifici per il modulo Piani Tariffari */

/* ===== CONTAINER PRINCIPALE ===== */
.rate-plans-module {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.module-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.module-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.module-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.module-content {
    padding: 25px;
}

/* ===== SEZIONE PIANI TARIFFARI ===== */
#section-rate-plans h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== CARD GENERICHE ===== */
.card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.4rem;
}

/* ===== GRIGLIA PIANI TARIFFARI ===== */
#rate-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.plan-card {
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.plan-card.inactive {
    opacity: 0.6;
    border-color: #ccc;
}

.plan-card .plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.plan-card .plan-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.plan-card .status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.status-badge.active {
    background: #4CAF50;
}

.status-badge.inactive {
    background: #f44336;
}

.plan-card .plan-info {
    margin: 10px 0;
}

.plan-card .plan-group {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-right: 10px;
}

.plan-card .plan-meal {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.plan-card .plan-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 15px 0;
}

.plan-card .plan-policies {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
}

.plan-card .policy-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

.plan-card .plan-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ===== BOTTONI ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ===== MODAL PIANO ===== */
#plan-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    overflow-y: auto;
}

#plan-modal .modal-content {
    background: white;
    max-width: 900px;
    margin: 50px auto;
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
}

#plan-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
}

#plan-modal .modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

#plan-modal .modal-body {
    padding: 30px;
}

#plan-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== SEZIONI FORM ===== */
.form-section {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.form-section.info-base {
    background: #f8f9fa;
}

.form-section.names {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
}

.form-section.descriptions {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.form-section.policies {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.form-section.terms {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

.form-section.image {
    background: linear-gradient(135deg, #fddb92 0%, #d1fdff 100%);
}

.form-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group input[readonly] {
    background: #e9ecef;
    cursor: not-allowed;
}

.form-group input[type="color"] {
    height: 42px;
    padding: 5px;
}

.form-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* ===== PREVIEW IMMAGINE ===== */
#image-preview img,
#current-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plan-card {
    animation: fadeIn 0.5s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #rate-plans-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #plan-modal .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    #plan-modal .modal-body {
        padding: 20px;
    }
    
    #plan-modal .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    #plan-modal .modal-footer button {
        width: 100%;
    }
}

/* ===== STATI SPECIALI ===== */
.plan-card.protected {
    border-left: 4px solid #ff9800;
}

.plan-card.protected::before {
    content: "🔒";
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
}

/* ===== ICONE E BADGES ===== */
.group-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.meal-icon {
    font-size: 1.2rem;
    margin-right: 5px;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show,
.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}