/* Simboli Comuni Page Styles */

/* ============================================
   MOBILE OPTIMIZATION - Full Width Elements
   ============================================ */
/* Forza colonne full-width su mobile e tablet */
@media screen and (max-width: 991.98px) {
    .row > div[class*="col-md-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 1rem !important;
    }
}

/* Category Cards - CSS Grid per distribuzione uniforme */
.categories-row {
    display: grid;
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
}

.category-item {
    display: flex;
    width: 100%;
    padding: 0;
    min-width: 0; /* Importante per CSS Grid */
}

.category-item > a {
    display: flex;
    width: 100%;
    min-width: 0;
}

.category-card {
    width: 100%;
    min-height: 100%;
    min-width: 0; /* Importante per evitare overflow */
    flex: 1;
}

/* Mobile: 1 colonna */
@media (max-width: 767.98px) {
    .categories-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .category-item {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Tablet: 2 colonne */
@media (min-width: 768px) and (max-width: 991.98px) {
    .categories-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 4 colonne fisse per avere tutte le card della stessa dimensione */
@media (min-width: 992px) {
    .categories-row {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .category-item {
        min-width: 0;
        max-width: 100%;
    }
    
    .category-card {
        box-sizing: border-box;
        max-width: 100%;
    }
}

.symbols-row {
    display: grid;
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
}

.symbol-item {
    display: flex;
    width: 100%;
    padding: 0;
}

/* Mobile: 1 colonna */
@media (max-width: 767.98px) {
    .symbols-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .symbol-item {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Tablet: 2 colonne */
@media (min-width: 768px) and (max-width: 991.98px) {
    .symbols-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 colonne */
@media (min-width: 992px) {
    .symbols-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Evita che il contenuto esca dalla card */
}

.category-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.category-card .card-body {
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.category-card .card-title {
    color: #212529;
    font-weight: 600;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.category-card a {
    text-decoration: none;
    color: inherit;
}

.category-card a:hover {
    text-decoration: none;
    color: inherit;
}

/* Symbol Cards */
.symbol-card {
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.symbol-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.symbol-icon {
    min-width: 60px;
    text-align: center;
    font-size: 2.5rem;
}

.symbol-meaning {
    line-height: 1.7;
}

.variations-section .badge {
    font-size: 0.85rem;
    padding: 5px 10px;
}

/* ============================================
   MOBILE OPTIMIZATION - Text & Layout
   ============================================ */
@media (max-width: 767.98px) {
    /* Prevenire overflow orizzontale */
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box;
    }
    
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    [class*="col-"] {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }
    
    .card-body {
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .card-header {
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Nav buttons responsive */
    .nav-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    
    .nav-button {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Assicura che le immagini non causino overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Form responsive */
    .form-control,
    .form-select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Badge e elementi inline */
    .badge {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Alert responsive */
    .alert {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Bottoni responsive */
    .btn {
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Testo generale più grande */
    /* Testo generale più grande */
    p, span, div, label {
        font-size: 1.05rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    /* Lead text più grande */
    .lead {
        font-size: 1.25rem !important;
        line-height: 1.8 !important;
    }
    
    /* Titoli più leggibili */
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.6rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    h4 {
        font-size: 1.4rem !important;
    }
    
    h5 {
        font-size: 1.2rem !important;
    }
    
    /* Card body padding ottimizzato */
    .card-body {
        padding: 1.25rem !important;
    }
    
    /* Category cards */
    .category-card .display-4 {
        font-size: 3.5rem !important;
    }
    
    .category-card .card-title {
        font-size: 1.3rem !important;
    }
    
    .category-card small {
        font-size: 1rem !important;
    }
    
    /* Symbol cards */
    .symbol-icon {
        font-size: 2rem !important;
        min-width: 50px;
    }
    
    .symbol-card .card-title {
        font-size: 1.3rem !important;
    }
    
    .symbol-meaning {
        font-size: 1.1rem !important;
        line-height: 1.8 !important;
    }
    
    /* Alert più leggibile */
    .alert {
        font-size: 1.05rem !important;
        padding: 1rem !important;
    }
    
    .alert h6 {
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .alert p {
        font-size: 1.05rem !important;
        line-height: 1.7 !important;
    }
    
    /* Badge */
    .variations-section .badge {
        font-size: 0.9rem !important;
        padding: 6px 10px !important;
    }
    
    /* Card footer */
    .card-footer {
        font-size: 1rem !important;
        padding: 1rem !important;
    }
    
    /* Bottoni */
    .btn-lg {
        font-size: 1.1rem !important;
        padding: 12px 24px !important;
        min-height: 48px !important;
    }
    
    /* Colonne full-width forzate */
    .col-md-6,
    .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Ottimizzazioni per schermi molto piccoli */
@media (max-width: 576px) {
    h1 {
        font-size: 1.6rem !important;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    h4 {
        font-size: 1.2rem !important;
    }
    
    h5 {
        font-size: 1.1rem !important;
    }
    
    .lead {
        font-size: 1.15rem !important;
    }
    
    body {
        font-size: 1.05rem !important;
    }
    
    p, span, div, label {
        font-size: 1.05rem !important;
    }
    
    .card-body {
        padding: 1.25rem !important;
    }
    
    .category-card .display-4 {
        font-size: 3rem !important;
    }
    
    .category-card .card-title {
        font-size: 1.2rem !important;
    }
    
    .symbol-icon {
        font-size: 1.75rem !important;
        min-width: 45px;
    }
    
    .symbol-card .card-title {
        font-size: 1.2rem !important;
    }
    
    .symbol-meaning {
        font-size: 1.05rem !important;
    }
    
    .alert {
        padding: 0.875rem !important;
    }
    
    .alert h6 {
        font-size: 1rem !important;
    }
    
    .alert p {
        font-size: 1rem !important;
    }
}

