* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

p:empty {
    display: none;
}

button.wpe-delete-history>br {
    display: none;
}

.cic {
    background: #000;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

.cic>header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cic>header>h1 {
    color: #FFF;
    font-size: 2.5rem;
    margin-bottom: 10px;
    margin: 0 auto;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.cic>header>.description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.cic>.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.cic>.controls>.cipher-toggle {
    color: #00FF00;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
}

.cic>.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.cic>.input-section>.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cic>.input-section>.input-group>label {
    font-size: 1.2rem;
    font-weight: 600;
}

.cic>.input-section>.input-group>input {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.cic>.input-section>.input-group>input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #00FF00;
    transform: translateY(-2px);
}

.cic>.results-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cic>.results-section>.cipher-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.cic>.results-section>.cipher-card:hover {
    transform: translateY(-5px);
}

.cic>.results-section>.cipher-card>.cipher-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    color: #fdbb2d;
    border-bottom: 1px solid rgba(253, 187, 45, 0.3);
    padding-bottom: 5px;
}

.cic>.results-section>.cipher-card>.cipher-value {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
}

.cic>.results-section>.cipher-card.ordinal>.cipher-name,
.cic>.results-section>.cipher-card.ordinal>.cipher-value,
#history-header-row th.ordinal,
#history-body td.ordinal,
#saved-history-header-row th.ordinal,
#saved-history-body td.ordinal {
    color: #00ba00;
    border-bottom: 1px solid #00ba00;
}

.cic>.results-section>.cipher-card.reduction>.cipher-name,
.cic>.results-section>.cipher-card.reduction>.cipher-value,
#history-header-row th.reduction,
#history-body td.reduction,
#saved-history-header-row th.reduction,
#saved-history-body td.reduction {
    color: #1FFF93;
    border-bottom: 1px solid #1FFF93;
}


.cic>.results-section>.cipher-card.reverse>.cipher-name,
.cic>.results-section>.cipher-card.reverse>.cipher-value,
#history-header-row th.reverse,
#history-body td.reverse,
#saved-history-header-row th.reverse,
#saved-history-body td.reverse {
    color: #FFF3C2;
    border-bottom: 1px solid #FFF3C2;
}

.cic>.results-section>.cipher-card.reverse-reduction>.cipher-name,
.cic>.results-section>.cipher-card.reverse-reduction>.cipher-value,
#history-header-row th.reverse-reduction,
#history-body td.reverse-reduction,
#saved-history-header-row th.reverse-reduction,
#saved-history-body td.reverse-reduction {
    color: #99FFCE;
    border-bottom: 1px solid #99FFCE;
}

.cic>.results-section>.cipher-card.standard>.cipher-name,
.cic>.results-section>.cipher-card.standard>.cipher-value,
#history-header-row th.standard,
#history-body td.standard,
#saved-history-header-row th.standard,
#saved-history-body td.standard {
    color: #FF914D;
    border-bottom: 1px solid #FF914D;
}

.cic>.results-section>.cipher-card.reverse-standard>.cipher-name,
.cic>.results-section>.cipher-card.reverse-standard>.cipher-value,
#history-header-row th.reverse-standard,
#history-body td.reverse-standard,
#saved-history-header-row th.reverse-standard,
#saved-history-body td.reverse-standard {
    color: #FFC099;
    border-bottom: 1px solid #FFC099;
}

.cic>.results-section>.cipher-card.latin>.cipher-name,
.cic>.results-section>.cipher-card.latin>.cipher-value,
#history-header-row th.latin,
#history-body td.latin,
#saved-history-header-row th.latin,
#saved-history-body td.latin {
    color: #FF1FA9;
    border-bottom: 1px solid #FF1FA9;
}

.cic>.results-section>.cipher-card.latin-ordinal>.cipher-name,
.cic>.results-section>.cipher-card.latin-ordinal>.cipher-value,
#history-header-row th.latin-ordinal,
#history-body td.latin-ordinal,
#saved-history-header-row th.latin-ordinal,
#saved-history-body td.latin-ordinal {
    color: #FF66C4;
    border-bottom: 1px solid #FF66C4;
}

.cic>.results-section>.cipher-card.latin-reduction>.cipher-name,
.cic>.results-section>.cipher-card.latin-reduction>.cipher-value,
#history-header-row th.latin-reduction,
#history-body td.latin-reduction,
#saved-history-header-row th.latin-reduction,
#saved-history-body td.latin-reduction {
    color: #FF99D8;
    border-bottom: 1px solid #FF99D8;
}

.cic>.results-section>.cipher-card.sumerian>.cipher-name,
.cic>.results-section>.cipher-card.sumerian>.cipher-value,
#history-header-row th.sumerian,
#history-body td.sumerian,
#saved-history-header-row th.sumerian,
#saved-history-body td.sumerian {
    color: #0CC0DF;
    border-bottom: 1px solid #0CC0DF;
}

.cic>.results-section>.cipher-card.reverse-sumerian>.cipher-name,
.cic>.results-section>.cipher-card.reverse-sumerian>.cipher-value,
#history-header-row th.reverse-sumerian,
#history-body td.reverse-sumerian,
#saved-history-header-row th.reverse-sumerian,
#saved-history-body td.reverse-sumerian {
    color: #99F0FF;
    border-bottom: 1px solid #99F0FF;
}

.cic>.results-section>.cipher-card.satanic>.cipher-name,
.cic>.results-section>.cipher-card.satanic>.cipher-value,
#history-header-row th.satanic,
#history-body td.satanic,
#saved-history-header-row th.satanic,
#saved-history-body td.satanic {
    color: #FF3131;
    border-bottom: 1px solid #FF3131;
}

.cic>.results-section>.cipher-card.reverse-satanic>.cipher-name,
.cic>.results-section>.cipher-card.reverse-satanic>.cipher-value,
#history-header-row th.reverse-satanic,
#history-body td.reverse-satanic,
#saved-history-header-row th.reverse-satanic,
#saved-history-body td.reverse-satanic {
    color: #CC0000;
    border-bottom: 1px solid #CC0000;
}

.cic>.results-section>.cipher-card.single-reduction>.cipher-name,
.cic>.results-section>.cipher-card.single-reduction>.cipher-value,
#history-header-row th.single-reduction,
#history-body td.single-reduction,
#saved-history-header-row th.single-reduction,
#saved-history-body td.single-reduction {
    color: #004AAD;
    border-bottom: 1px solid #004AAD;
}

.cic>.results-section>.cipher-card.reverse-single-reduction>.cipher-name,
.cic>.results-section>.cipher-card.reverse-single-reduction>.cipher-value,
#history-header-row th.reverse-single-reduction,
#history-body td.reverse-single-reduction,
#saved-history-header-row th.reverse-single-reduction,
#saved-history-body td.reverse-single-reduction {
    color: #1F80FF;
    border-bottom: 1px solid #1F80FF;
}

.cic>.results-section>.cipher-card.chaldean>.cipher-name,
.cic>.results-section>.cipher-card.chaldean>.cipher-value,
#history-header-row th.chaldean,
#history-body td.chaldean,
#saved-history-header-row th.chaldean,
#saved-history-body td.chaldean {
    color: #D3FF99;
    border-bottom: 1px solid #D3FF99;
}

.cic>.results-section>.cipher-card.septenary>.cipher-name,
.cic>.results-section>.cipher-card.septenary>.cipher-value,
#history-header-row th.septenary,
#history-body td.septenary,
#saved-history-header-row th.septenary,
#saved-history-body td.septenary {
    color: #4CA626;
    border-bottom: 1px solid #4CA626;
}

.cic>.results-section>.cipher-card.keypad>.cipher-name,
.cic>.results-section>.cipher-card.keypad>.cipher-value,
#history-header-row th.keypad,
#history-body td.keypad,
#saved-history-header-row th.keypad,
#saved-history-body td.keypad {
    color: #5E17EB;
    border-bottom: 1px solid #5E17EB;
}

.cic>.results-section>.cipher-card>.cipher-value {
    border-bottom: none !important;
}

.cic>.total-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cic>.total-section>h2 {
    color: #FFF;
    margin-bottom: 15px;
    text-align: center;
}

.cic>.total-section>.word-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.cic>.total-section>.word-totals>.word-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    min-width: 150px;
}

.cic>.total-section>.word-totals>.word-item>.word-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.cic>.total-section>.word-totals>.word-item>.word-total {
    font-size: 1.5rem;
    color: #fdbb2d;
    font-weight: 700;
}

.cic>.total-section>.word-totals>.word-item>.word-chars {
    margin-top: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.cic>.chart-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cic>.chart-section>h2 {
    color: #FFF;
    margin-bottom: 15px;
    text-align: center;
}

.cic>.chart-section>.chart-container {
    /* height: 300px; */
    position: relative;
    padding: 10px;
}

.cic>.history-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
}

.cic>#saved-history-section {
    display: block
}

.cic>.history-section>.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cic>.history-section>.history-header>h2 {
    color: #FFF;
}

.cic>.history-section>.history-header>.history-controls {
    display: flex;
    gap: 10px;
}

.cic .btn {
    padding: 8px 15px;
    background: #FFF;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cic .btn:hover {
    background: rgba(225, 225, 225, 0.7);
    transform: translateY(-2px);
}

.cic .btn-secondary {
    background: rgba(225, 225, 225, 0.3);
    color: #FFF;
}

.cic table {
    width: 100%;
    border-collapse: collapse;
}

.cic th,
.cic td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.cic th {
    color: #FFF;
}

.cic tr {
    position: relative;
}

.cic tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.cic .text-cell {
    position: relative;
    cursor: pointer;
}

.cic .dropdown {
    position: absolute;
    top: 50%;
    left: 20%;
    background-color: rgba(30, 30, 40, 0.95);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
    z-index: 1;
    border-radius: 5px;
    /* overflow: hidden; */
    display: none;
}

.cic .text-cell:hover .dropdown {
    display: block;
}

.cic .dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cic .dropdown-content a:last-child {
    border-bottom: none;
}

.cic .dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.cic .sub-dropdown {
    position: relative;
}

.cic .sub-dropdown-content {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: rgba(40, 40, 50, 0.95);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
}

.cic .sub-dropdown:hover .sub-dropdown-content {
    display: block;
}

.cic .no-history {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

.cic .instructions {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

div#history-table-container,
div.history-table-container {
    overflow: auto;
    padding-bottom: 250px;
}

div.history-table-container {
    padding-bottom: 20px;
}


/* Modal styles */
.cic>.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.cic>.modal>.modal-content {
    background: #000;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(225, 225, 225, 0.5);
}

.cic>.modal>.modal-content>.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(253, 187, 45, 0.3);
    padding-bottom: 10px;
}

.cic>.modal>.modal-content>.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid rgba(253, 187, 45, 0.3);
    padding-top: 10px;
}


.cic>.modal>.modal-content>.modal-footer .select-controls {
    display: flex;
    gap: 15px;
    margin-left: auto;
}

.cic>.modal>.modal-content>.modal-footer .btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.cic>.modal>.modal-content>.modal-header>h2 {
    color: #FFF;
}

.cic>.modal>.modal-content>.modal-header>.close {
    color: #FFF;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.cic>.modal>.modal-content>.modal-header>.close:hover {
    color: #FFF;
}

.cic>.modal>.modal-content>.cipher-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.cic>.modal>.modal-content>.cipher-list>.cipher-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
}

.cic>.modal>.modal-content>.cipher-list>.cipher-option>input {
    margin: 0;
}

@media(max-width:1025px) {
    .cic .results-section {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .cic>.history-section>.history-header>h2 {
        text-align: center;
    }

    .cic>header>.description {
        font-size: 0.8rem;
    }

    .cic .cipher-card {
        padding: 10px !important;
    }

    .cic .results-section .cipher-name {
        font-size: 1rem !important;
    }

    .cic .results-section .cipher-value {
        font-size: 1rem !important;
    }

    .cic th,
    .cic td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .cic .history-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .cic .controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media(max-width:400px) {
    .cic .results-section .cipher-name {
        font-size: 10px !important;
    }

    .cic .results-section .cipher-value {
        font-size: 10px !important;
    }
}