/* Akiba Diccionario v4 - diseño card moderno */
.akiba-diccionario-wrap{
    max-width: 980px;
    margin: 34px auto;
    font-family: 'Poppins', Arial, sans-serif;
    color: #21152f;
}

.akiba-translate-card{
    background: #ffffff;
    border: 1px solid rgba(88, 48, 125, .08);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(26,9,43,.16),0 10px 25px rgba(26,9,43,.12);
    margin-bottom: 18px;
}

.akiba-main-card{
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(224, 7, 7, .10), transparent 35%),
        linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%);
}

.akiba-card-badge{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(224, 7, 7, .08);
    color: #E00707;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 12px;
}

.akiba-header h2{
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -.8px;
    color: #2b173f;
}

.akiba-header p{
    margin: 0 0 22px;
    color: #6e5b82;
    font-size: 15px;
    line-height: 1.55;
}

.akiba-lang-grid{
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}

.akiba-field > span,
.akiba-textarea-label,
.akiba-mini-label{
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #7b668e;
}

.akiba-field select,
#akiba-word{
    width: 100%;
    border: 1px solid rgba(88,48,125,.14);
    background: #fff;
    color: #2b173f;
    border-radius: 16px;
    outline: none;
    transition: border .2s ease, box-shadow .2s ease;
    box-sizing: border-box;
}

.akiba-field select{
    min-height: 52px;
    padding: 0 14px;
    font-size: 15px;
    cursor: pointer;
}

#akiba-word{
    resize: vertical;
    min-height: 140px;
    padding: 16px;
    font-size: 16px;
    line-height: 1.55;
}

.akiba-field select:focus,
#akiba-word:focus{
    border-color: rgba(224,7,7,.5);
    box-shadow: 0 0 0 4px rgba(224,7,7,.08);
}

.akiba-swap{
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #2b173f;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.akiba-swap:hover{
    transform: rotate(180deg);
    background: #E00707;
}

.akiba-actions{
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

.akiba-btn,
.akiba-btn-secondary,
.akiba-copy,
.akiba-clear{
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.akiba-btn{
    background: #E00707;
    color: #fff;
    padding: 14px 24px;
    box-shadow: 0 12px 24px rgba(224,7,7,.22);
}

.akiba-btn:hover{
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(224,7,7,.28);
}

.akiba-btn-secondary,
.akiba-copy,
.akiba-clear{
    background: #f3edf8;
    color: #3a2254;
    padding: 12px 16px;
}

.akiba-btn-secondary:hover,
.akiba-copy:hover,
.akiba-clear:hover{
    background: #eadff3;
}

.akiba-copy:disabled{
    opacity: .5;
    cursor: not-allowed;
}

.akiba-result-head,
.akiba-history-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.akiba-result-head h3,
.akiba-history-head h3{
    margin: 0;
    color: #2b173f;
    font-size: 20px;
    line-height: 1.2;
}

.akiba-result{
    min-height: 86px;
    display: flex;
    align-items: center;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fbf8ff 0%, #ffffff 100%);
    border: 1px solid rgba(88,48,125,.08);
    color: #2b173f;
    font-size: 22px;
    line-height: 1.55;
    word-break: break-word;
}

.akiba-result strong{
    font-weight: 800;
}

.akiba-placeholder{
    color: #8c7b9b;
    font-size: 16px;
}

.akiba-error{
    width: 100%;
    background: #fff0f2;
    border: 1px solid #ffd6dd;
    color: #8a1b1b;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 15px;
}

.akiba-loading{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #6e5b82;
    font-size: 16px;
}

.akiba-loading::before{
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid rgba(224,7,7,.15);
    border-top-color: #E00707;
    animation: akibaSpin .8s linear infinite;
}

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

#akiba-historial-list{
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

#akiba-historial-list li{
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #fbf8ff;
    border-radius: 16px;
    border: 1px solid rgba(88,48,125,.07);
}

.akiba-flag{
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(26,9,43,.06);
}

.akiba-item-text{
    font-size: 14px;
    line-height: 1.45;
    color: #2b173f;
    font-weight: 700;
}

.akiba-item-text span{
    display: block;
    margin-top: 3px;
    color: #6e5b82;
    font-weight: 500;
}

@media (max-width: 700px){
    .akiba-diccionario-wrap{
        margin: 22px auto;
    }

    .akiba-translate-card{
        padding: 18px;
        border-radius: 18px;
    }

    .akiba-header h2{
        font-size: 28px;
    }

    .akiba-lang-grid{
        grid-template-columns: 1fr;
    }

    .akiba-swap{
        width: 46px;
        height: 46px;
        justify-self: center;
        transform: rotate(90deg);
    }

    .akiba-swap:hover{
        transform: rotate(270deg);
    }

    .akiba-actions{
        flex-direction: column;
        align-items: stretch;
    }

    .akiba-btn,
    .akiba-btn-secondary{
        width: 100%;
    }

    .akiba-result-head,
    .akiba-history-head{
        align-items: flex-start;
        flex-direction: column;
    }

    .akiba-result{
        font-size: 19px;
        min-height: 74px;
    }
}

/* Akiba Diccionario v5 - selectores custom con banderas SVG */
.akiba-native-select{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    opacity:0!important;
    pointer-events:none!important;
}

.akiba-custom-select{
    position:relative;
    width:100%;
}

.akiba-custom-select-btn{
    width:100%;
    min-height:52px;
    border:1px solid rgba(88,48,125,.14);
    background:#fff;
    color:#2b173f;
    border-radius:16px;
    padding:0 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    cursor:pointer;
    font-size:15px;
    transition:border .2s ease, box-shadow .2s ease, transform .2s ease;
    box-sizing:border-box;
}

.akiba-custom-select-btn:hover,
.akiba-custom-select.is-open .akiba-custom-select-btn{
    border-color:rgba(224,7,7,.45);
    box-shadow:0 0 0 4px rgba(224,7,7,.08);
}

.akiba-selected-lang,
.akiba-option-lang{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.akiba-flag-svg{
    width:28px;
    height:28px;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 28px;
    overflow:hidden;
    box-shadow:0 3px 8px rgba(26,9,43,.14);
    background:#fff;
}

.akiba-flag-svg svg{
    width:28px;
    height:28px;
    display:block;
}

.akiba-lang-name{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.akiba-select-chevron{
    font-size:14px;
    color:#6e5b82;
    transition:transform .2s ease;
}

.akiba-custom-select.is-open .akiba-select-chevron{
    transform:rotate(180deg);
}

.akiba-custom-options{
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;
    z-index:50;
    padding:8px;
    margin:0;
    list-style:none;
    background:#fff;
    border:1px solid rgba(88,48,125,.12);
    border-radius:18px;
    box-shadow:0 22px 50px rgba(26,9,43,.18),0 8px 22px rgba(26,9,43,.12);
    display:none;
}

.akiba-custom-select.is-open .akiba-custom-options{
    display:block;
}

.akiba-custom-option{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    min-height:44px;
    padding:8px 10px;
    border:none;
    background:transparent;
    border-radius:12px;
    color:#2b173f;
    cursor:pointer;
    font-size:15px;
    text-align:left;
    transition:background .2s ease, color .2s ease;
}

.akiba-custom-option:hover,
.akiba-custom-option.is-active{
    background:#fbedf0;
    color:#E00707;
}

#akiba-historial-list .akiba-flag{
    font-size:0;
}

#akiba-historial-list .akiba-flag .akiba-flag-svg{
    width:32px;
    height:32px;
    flex-basis:32px;
}

#akiba-historial-list .akiba-flag .akiba-flag-svg svg{
    width:32px;
    height:32px;
}


/* Akiba Diccionario v5.1 - ajustes de usabilidad */

/* Evita que los estilos del label afecten banderas y nombres dentro del selector */
.akiba-custom-select span,
.akiba-custom-select-btn span,
.akiba-custom-option span{
    margin:0!important;
    padding:0!important;
    text-transform:none!important;
    letter-spacing:normal!important;
}

/* Selectores: bandera e idioma siempre en una sola linea */
.akiba-selected-lang,
.akiba-custom-option{
    display:flex!important;
    align-items:center!important;
    flex-direction:row!important;
}

.akiba-selected-lang{
    gap:10px!important;
    min-width:0!important;
    width:100%!important;
}

.akiba-custom-option{
    gap:10px!important;
}

.akiba-custom-select-btn{
    overflow:hidden!important;
}

/* Dropdown sin bullets */
.akiba-custom-options,
.akiba-custom-options li,
.akiba-custom-options ul{
    list-style:none!important;
    margin-left:0!important;
    padding-left:0!important;
}

.akiba-custom-options li::marker{
    content:''!important;
    display:none!important;
}

.akiba-custom-options li{
    margin:0!important;
    padding:0!important;
}

/* Todas las banderas con el mismo tamaño */
.akiba-flag-svg{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    max-width:30px!important;
    flex:0 0 30px!important;
    border-radius:50%!important;
    overflow:hidden!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
}

.akiba-flag-svg svg{
    width:30px!important;
    height:30px!important;
    display:block!important;
}

/* Historial: cards chicas, en filas/columnas compactas */
#akiba-historial-list{
    display:grid!important;
    grid-template-columns:repeat(2, minmax(0, 1fr))!important;
    gap:12px!important;
}

#akiba-historial-list li{
    display:flex!important;
    align-items:center!important;
    min-height:auto!important;
    padding:14px 16px!important;
    border-radius:18px!important;
    background:#fbf8ff!important;
    border:1px solid rgba(88,48,125,.10)!important;
    box-shadow:0 10px 24px rgba(26,9,43,.08)!important;
}

.akiba-history-line{
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
    color:#2b173f!important;
    font-size:15px!important;
    line-height:1.25!important;
}

.akiba-history-pair{
    display:flex!important;
    align-items:center!important;
    gap:8px!important;
    min-width:0!important;
}

.akiba-history-pair strong,
.akiba-history-pair span:last-child{
    display:block!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
}

.akiba-history-pair strong{
    font-weight:800!important;
    color:#2b173f!important;
}

.akiba-history-pair span:last-child{
    color:#6e5b82!important;
    font-weight:600!important;
}

.akiba-history-arrow{
    color:#8c7b9b!important;
    font-weight:800!important;
    flex:0 0 auto!important;
}

.akiba-history-empty{
    grid-column:1 / -1!important;
}

.akiba-history-empty .akiba-history-line{
    color:#6e5b82!important;
}

@media (max-width:700px){
    #akiba-historial-list{
        grid-template-columns:1fr!important;
    }

    .akiba-history-line{
        font-size:14px!important;
    }
}


/* Akiba Diccionario v5.2 - fix desplegables custom */
.akiba-custom-select{
    position:relative!important;
    z-index:20!important;
}

.akiba-custom-select.is-open{
    z-index:999!important;
}

.akiba-custom-options{
    z-index:9999!important;
    max-height:280px!important;
    overflow-y:auto!important;
}

.akiba-custom-options,
.akiba-custom-options li{
    list-style-type:none!important;
}

.akiba-custom-options li::before{
    content:none!important;
    display:none!important;
}
