/* Main tool container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    text-align: left;
}

/* Encoding selector — golden luxury */
.encoding-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.encoding-btn {
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.95));
    border: 1px solid rgba(145, 103, 48, 0.28);
    color: #7a572c;
    padding: 15px 25px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}

.encoding-btn:hover {
    border-color: #ab7c34;
    background: linear-gradient(180deg, rgba(255, 252, 246, 1), rgba(245, 232, 211, 0.98));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(94, 65, 30, 0.35);
}

.encoding-btn.active {
    background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
    color: #fff8ef;
    border-color: rgba(121, 85, 40, 0.48);
    box-shadow: 0 8px 22px -10px rgba(145, 103, 48, 0.45);
}

.encoding-btn i {
    font-size: 1.1rem;
}

/* Tool section */
.tool-section {
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.97));
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(145, 103, 48, 0.2);
    box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.35);
    margin-bottom: 30px;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    color: #5e4329;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: transparent;
    border: 1px solid rgba(145, 103, 48, 0.35);
    color: #7a572c;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

#copyOutput.copied {
    animation: copyPulse 0.6s ease;
    box-shadow: 0 0 12px rgba(182, 138, 58, 0.35);
}

#copyOutput.copied svg {
    display: inline-block;
    vertical-align: middle;
}

@keyframes copyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.action-btn:hover {
    background: rgba(182, 138, 58, 0.12);
    border-color: #ab7c34;
    color: #5e4329;
}

/* Input and output sections */
.input-section,
.output-section {
    margin-bottom: 25px;
}

.input-section textarea,
.output-section textarea {
    width: 100%;
    background: #fffaf2;
    border: 1px solid rgba(145, 103, 48, 0.26);
    border-radius: 12px;
    padding: 16px;
    color: #4a351f;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.input-section textarea:focus,
.output-section textarea:focus {
    outline: none;
    border-color: #ab7c34;
    box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.16);
}

.input-section textarea::placeholder,
.output-section textarea::placeholder {
    color: #8c7558;
}

.output-section textarea {
    background: #fff8ef;
    border-color: rgba(145, 103, 48, 0.18);
}

.char-counter {
    margin-top: 8px;
    font-size: 0.8rem;
    color: rgba(88, 64, 38, 0.65);
    text-align: right;
}

/* Control section */
.control-section {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.control-section i {
    margin-right: 10px;
}

.operation-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-tertiary {
    background: linear-gradient(180deg, #e8dcc8, #ddd0bc);
    color: #5e4329;
    border: 1px solid rgba(145, 103, 48, 0.28);
}

.btn-tertiary:hover {
    background: linear-gradient(180deg, #f0e6d4, #e5d8c4);
    color: #4f3a24;
    transform: scale(1.05);
    border-color: #ab7c34;
}

/* Info section */
.info-section {
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(245, 232, 211, 0.9));
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(145, 103, 48, 0.18);
    margin-bottom: 0;
}

.encoding-info h4 {
    color: #5e4329;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.encoding-info p {
    color: rgba(88, 64, 38, 0.88);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.info-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.info-tag {
    background: rgba(182, 138, 58, 0.12);
    color: #7a5526;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px dashed rgba(145, 103, 48, 0.3);
    word-break: break-all;
    max-width: 100%;
}

/* Status section */
.status-section {
    text-align: center;
    margin-top: 20px;
}

.status-message {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: none;
}

.status-message.success {
    background: rgba(107, 143, 60, 0.12);
    color: #5a6f2e;
    border: 1px solid rgba(107, 143, 60, 0.35);
    display: block;
}

.status-message.error {
    background: rgba(173, 82, 47, 0.12);
    color: #9a3f2b;
    border: 1px solid rgba(154, 63, 43, 0.28);
    display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .tool-container {
        padding: 0;
    }

    .encoding-selector {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .encoding-btn {
        min-width: 250px;
        padding: 12px 20px;
    }

    .tool-section {
        padding: 20px;
    }

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

    .action-buttons {
        align-self: flex-end;
    }

    .operation-buttons {
        justify-content: center;
        width: 100%;
    }

    .info-details {
        justify-content: center;
    }

    .info-section {
        margin-bottom: 100px;
    }

    .info-tag {
        font-size: 0.75rem;
        padding: 5px 10px;
        word-break: break-all;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .encoding-btn {
        min-width: 200px;
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    .tool-section {
        padding: 15px;
    }

    .operation-buttons {
        flex-direction: row;
        width: 100%;
        gap: 10px;
        flex-wrap: wrap;
    }

    #encodeBtn,
    #decodeBtn {
        flex: 1;
        min-width: auto;
    }

    #swapBtn {
        width: 100%;
        margin-top: 10px;
    }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
    color: #fff8ef;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    animation: slideInToast 0.3s ease !important;
}

.toast.success {
    background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
}

.toast.error {
    background: #c94a3a;
    color: #fff;
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .toast {
        top: auto;
        bottom: 100px;
        left: 20px;
        right: 20px;
    }
}
