/* MD4 Hash Generator - Mobile-first, modern layout */

/* --- Interface wrapper --- */
.md4-interface {
    margin-bottom: 2rem;
}

/* --- Full-width two-column card --- */
.md4-full-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--bs-body-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

@media (min-width: 768px) {
    .md4-full-card {
        grid-template-columns: 1fr 1fr;
        border-radius: 14px;
    }
}

.md4-card-left {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .md4-card-left {
        padding: 1.5rem;
        border-right: 1px solid rgba(0, 0, 0, 0.08);
    }
}

.md4-card-right {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.02);
}

@media (min-width: 768px) {
    .md4-card-right {
        padding: 1.5rem;
        min-height: 320px;
        border-left: 1px solid #0d9488;
    }
}

/* --- Labels --- */
.md4-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color, #1a1a1a);
    margin-bottom: 0.5rem;
}

.md4-textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--bs-body-color, #1a1a1a);
    background: var(--bs-body-bg, #fff);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.md4-textarea::placeholder {
    color: var(--text-muted, #6b7280);
}

.md4-textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.md4-input-meta {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

.md4-char-count {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
}

/* --- File zone --- */
.md4-file-zone {
    position: relative;
    border: 2px dashed rgba(0, 0, 0, 0.14);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background: rgba(0, 0, 0, 0.02);
}

.md4-file-zone:hover {
    border-color: #0d9488;
    background: rgba(13, 148, 136, 0.04);
}

.md4-file-zone.md4-dragover {
    border-color: #0d9488;
    background: rgba(13, 148, 136, 0.08);
}

.md4-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.md4-file-inner {
    pointer-events: none;
}

.md4-file-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center / 40px no-repeat;
}

.md4-file-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bs-body-color, #1a1a1a);
    margin: 0 0 0.25rem 0;
}

.md4-file-hint {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

/* --- Actions --- */
.md4-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.md4-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    border: none;
}

.md4-btn:active {
    transform: scale(0.98);
}

.md4-btn-generate {
    background: #0d9488;
    color: #fff;
}

.md4-btn-generate:hover {
    background: #0f766e;
}

.md4-btn-clear {
    background: transparent;
    color: var(--bs-body-color, #374151);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.md4-btn-clear:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

.md4-btn-copy {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #0d9488;
    color: #fff;
}

.md4-btn-copy:hover:not(:disabled) {
    background: #0f766e;
}

.md4-btn-copy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.md4-btn-copy.copied {
    background: #059669;
}

.md4-output-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.md4-output-head .md4-label {
    margin-bottom: 0;
}

.md4-output-box {
    flex: 1;
    min-height: 120px;
    padding: 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--bs-body-color, #1a1a1a);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    word-break: break-all;
    white-space: pre-wrap;
}

.md4-output-box .md4-placeholder {
    color: var(--text-muted, #6b7280);
    font-style: normal;
}

.md4-output-box.has-hash .md4-placeholder {
    display: none;
}

.md4-output-box.has-hash {
    color: #0d9488;
    font-weight: 500;
}

@media (min-width: 768px) {
    .md4-output-box {
        min-height: 160px;
        font-size: 1rem;
    }
}
