/* Phonetic Alphabet Translator Styles */

#phonetic-alphabet-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    /* Rimossi stili card */
}

#text-input {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 50px;
}

#text-input:focus {
    border-color: #55ddff;
    box-shadow: 0 0 20px rgba(85, 221, 255, 0.3);
    outline: none;
}

#text-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Button Styles */
.btn-action {
    background: linear-gradient(135deg, #55ddff, #4aa3ff);
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(85, 221, 255, 0.3);
    color: #000;
    flex: 1;
    max-width: 200px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(85, 221, 255, 0.4);
    color: #000;
}

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

/* Output Section */
#output-section {
    margin-bottom: 2rem;
}

.phonetic-result {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 120px;
}

.phonetic-result.cards-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.phonetic-result.row-layout {
    display: block;
}

.phonetic-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.phonetic-table th,
.phonetic-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
}

.phonetic-table th {
    background: rgba(85, 221, 255, 0.2);
    color: #55ddff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.phonetic-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.phonetic-word-index {
    color: #55ddff;
    font-weight: bold;
    min-width: 60px;
}

.phonetic-word-chars {
    color: #55ddff;
    font-weight: 600;
}

.phonetic-word-phonetic {
    color: #e0e0e0;
}

/* Layout a righe per testi lunghi */
.phonetic-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, rgba(85, 221, 255, 0.1), rgba(85, 221, 255, 0.05));
    border: 1px solid rgba(85, 221, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
}

.phonetic-row:hover {
    background: linear-gradient(135deg, rgba(85, 221, 255, 0.15), rgba(85, 221, 255, 0.08));
    transform: translateX(5px);
}

.phonetic-char {
    display: inline-block;
    background: linear-gradient(135deg, #55ddff, #4aa3ff);
    color: #000;
    font-weight: 900;
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    min-width: 50px;
    text-align: center;
    margin-right: 1rem;
    text-transform: uppercase;
}

.phonetic-desc {
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

/* Switch container */
#switches-container {
    animation: fadeInUp 0.5s ease-out;
}

#switches-container span {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

#switches-container .form-check-input:checked {
    background-color: #55ddff;
    border-color: #55ddff;
}

#switches-container .form-check-input:focus {
    border-color: #55ddff;
    box-shadow: 0 0 0 0.25rem rgba(85, 221, 255, 0.25);
}

.phonetic-item {
    display: inline-block;
    background: linear-gradient(135deg, rgba(85, 221, 255, 0.2), rgba(85, 221, 255, 0.1));
    border: 1px solid rgba(85, 221, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
    flex: 1;
    max-width: 200px;
}

.phonetic-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(85, 221, 255, 0.4);
}

.phonetic-city {
    font-size: 1.2rem;
    font-weight: 700;
    color: #55ddff;
    margin-bottom: 0.25rem;
}

.phonetic-letter {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
}

.phonetic-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: #55ddff;
}

.phonetic-special {
    font-size: 1rem;
    font-weight: 600;
    color: #55ddff;
}

.phonetic-space {
    width: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Info Section */
.info-section {
    background: rgba(85, 221, 255, 0.1);
    border: 1px solid rgba(85, 221, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-section h5 {
    color: #55ddff;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.info-item i {
    color: #55ddff;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.info-item span {
    color: #e0e0e0;
    font-size: 0.95rem;
}

/* Alphabet Reference */
.alphabet-reference h5 {
    color: #55ddff;
    margin-bottom: 2rem;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.alphabet-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.alphabet-item:hover {
    background: rgba(85, 221, 255, 0.1);
    border-color: rgba(85, 221, 255, 0.3);
    transform: translateY(-2px);
}

.alphabet-letter {
    font-size: 1.5rem;
    font-weight: 900;
    color: #55ddff;
    margin-bottom: 0.25rem;
}

.alphabet-city {
    font-size: 1rem;
    color: #e0e0e0;
    font-weight: 600;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Copy success animation */
.copy-success {
    animation: copyFlash 0.6s ease-in-out;
}

@keyframes copyFlash {
    0% { background-color: rgba(45, 213, 115, 0.2); }
    50% { background-color: rgba(45, 213, 115, 0.4); }
    100% { background-color: transparent; }
}

/* Responsive columns based on character count */
.phonetic-result.many-chars .phonetic-item {
    min-width: 60px;
    max-width: 120px;
    padding: 0.4rem 0.6rem;
    margin: 0.2rem;
}

.phonetic-result.very-many-chars .phonetic-item {
    min-width: 50px;
    max-width: 80px;
    padding: 0.3rem 0.5rem;
    margin: 0.15rem;
}

.phonetic-result.extremely-many-chars .phonetic-item {
    min-width: 40px;
    max-width: 60px;
    padding: 0.25rem 0.4rem;
    margin: 0.1rem;
}

/* Mobile Optimization */
@media only screen and (max-width: 768px) {
    
    #text-input {
        font-size: 1rem;
        min-height: 45px;
    }
    
    .btn-action {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 0.25rem;
    }
    
    .phonetic-item {
        min-width: 70px;
        max-width: 100px;
        padding: 0.5rem 0.6rem;
        margin: 0.2rem;
    }
    
    .phonetic-city {
        font-size: 1rem;
    }
    
    .phonetic-letter {
        font-size: 1.2rem;
    }
    
    .phonetic-number {
        font-size: 1.3rem;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .alphabet-item {
        padding: 0.75rem;
    }
    
    .alphabet-letter {
        font-size: 1.3rem;
    }
    
    .alphabet-city {
        font-size: 0.9rem;
    }
    
    .phonetic-table {
        font-size: 0.85rem;
    }
    
    .phonetic-table th,
    .phonetic-table td {
        padding: 0.5rem 0.25rem;
    }
}

@media only screen and (max-width: 480px) {
    .btn-action {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex: 1;
        max-width: none;
    }
    
    /* Switch alfabeto su mobile */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .phonetic-item {
        width: calc(50% - 1rem);
        margin: 0.25rem 0.5rem;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-section .row {
        margin: 0;
    }
    
    .info-section .col-md-6 {
        padding: 0;
    }
}

/* Loading animation */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(85, 221, 255, 0.3);
    border-top: 2px solid #55ddff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}