/* ============================================================
   Vamriko - IMAGE TO TEXT
   Premium isolated tool styling
   ============================================================ */
.ocr-root {
    --ocr-purple: #7c5cff;
    --ocr-purple-light: #9b83ff;
    --ocr-purple-dark: #5d42d9;
    --ocr-purple-soft: rgba(124, 92, 255, .14);
    --ocr-border: rgba(156, 137, 255, .18);
    --ocr-border-hover: rgba(156, 137, 255, .38);
    --ocr-surface: rgba(18, 15, 34, .88);
    --ocr-surface-2: rgba(25, 20, 46, .92);
    --ocr-text: #f5f3ff;
    --ocr-muted: #a7a1bd;
    --ocr-success: #65e6a1;
    --ocr-danger: #ff6b8a;
    width: 100%;
    margin: 28px 0 70px;
}
/* ============================================================
   MAIN CARD
   ============================================================ */
.ocr-tool {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ocr-border);
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(124, 92, 255, .13),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 100%,
            rgba(96, 64, 180, .09),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            rgba(18, 15, 35, .98),
            rgba(11, 10, 22, .98)
        );
    box-shadow:
        0 28px 80px rgba(0, 0, 0, .35),
        inset 0 1px 0 rgba(255,255,255,.035);
}
/* subtle top glow */
.ocr-tool::before {
    content: "";
    position: absolute;
    left: 15%;
    right: 15%;
    top: -90px;
    height: 180px;
    background: rgba(124, 92, 255, .13);
    filter: blur(70px);
    pointer-events: none;
}
/* ============================================================
   TOP BAR
   ============================================================ */
.ocr-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(8, 7, 18, .42);
    backdrop-filter: blur(16px);
}
.ocr-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 220px;
}
.ocr-brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background:
        linear-gradient(
            145deg,
            rgba(124,92,255,.28),
            rgba(91,63,190,.12)
        );
    border: 1px solid rgba(156,137,255,.24);
    box-shadow:
        0 8px 24px rgba(89,64,200,.18),
        inset 0 1px 0 rgba(255,255,255,.06);
    color: #cfc5ff;
}
.ocr-brand-icon svg {
    width: 21px;
    height: 21px;
}
.ocr-brand-title {
    color: var(--ocr-text);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .02em;
}
.ocr-brand-subtitle {
    margin-top: 3px;
    color: var(--ocr-muted);
    font-size: 11px;
}
/* ============================================================
   CONTROLS
   ============================================================ */
.ocr-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
.ocr-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 7px 10px 7px 13px;
    border: 1px solid rgba(156,137,255,.15);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}
.ocr-control-label {
    color: #8f88a8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ocr-control select {
    min-width: 150px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #eeeaff;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.ocr-control select option {
    background: #171329;
    color: #f5f3ff;
}
/* ============================================================
   WORKSPACE
   ============================================================ */
.ocr-workspace {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 18px;
    padding: 20px;
}
/* ============================================================
   PANELS
   ============================================================ */
.ocr-panel {
    min-width: 0;
    border: 1px solid rgba(156,137,255,.13);
    border-radius: 19px;
    background:
        linear-gradient(
            145deg,
            rgba(28,23,48,.78),
            rgba(14,12,27,.86)
        );
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.025),
        0 12px 35px rgba(0,0,0,.15);
    overflow: hidden;
}
.ocr-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 17px;
    border-bottom: 1px solid rgba(255,255,255,.055);
}
.ocr-panel-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ocr-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ocr-purple);
    box-shadow:
        0 0 0 4px rgba(124,92,255,.10),
        0 0 18px rgba(124,92,255,.5);
}
.ocr-panel-title {
    color: #f0edff;
    font-size: 13px;
    font-weight: 750;
}
.ocr-panel-meta {
    color: #77718e;
    font-size: 11px;
}
/* ============================================================
   UPLOAD AREA
   ============================================================ */
.ocr-upload {
    margin: 16px;
    min-height: 455px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(156,137,255,.30);
    border-radius: 16px;
    background:
        radial-gradient(
            circle at 50% 30%,
            rgba(124,92,255,.09),
            transparent 40%
        ),
        rgba(6,5,15,.30);
    transition:
        border-color .2s ease,
        background .2s ease,
        transform .2s ease;
}
.ocr-upload:hover,
.ocr-upload.is-dragging {
    border-color: rgba(156,137,255,.65);
    background:
        radial-gradient(
            circle at 50% 30%,
            rgba(124,92,255,.16),
            transparent 48%
        ),
        rgba(10,8,22,.46);
}
.ocr-upload-inner {
    width: 100%;
    max-width: 420px;
    padding: 30px;
    text-align: center;
}
.ocr-upload-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #cfc5ff;
    background:
        linear-gradient(
            145deg,
            rgba(124,92,255,.20),
            rgba(91,63,190,.08)
        );
    border: 1px solid rgba(156,137,255,.24);
    box-shadow:
        0 14px 40px rgba(87,63,192,.16);
}
.ocr-upload-icon svg {
    width: 31px;
    height: 31px;
}
.ocr-upload-title {
    color: #f4f1ff;
    font-size: 17px;
    font-weight: 750;
}
.ocr-upload-text {
    margin: 9px auto 19px;
    max-width: 330px;
    color: #858098;
    font-size: 12px;
    line-height: 1.65;
}
.ocr-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    padding: 0 20px;
    border: 1px solid rgba(156,137,255,.35);
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            #7657ed,
            #5e43cb
        );
    color: white;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    box-shadow:
        0 10px 25px rgba(93,66,205,.24);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}
.ocr-upload-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 32px rgba(93,66,205,.34);
    filter: brightness(1.08);
}
.ocr-upload-note {
    margin-top: 13px;
    color: #625d75;
    font-size: 10px;
}
/* ============================================================
   PREVIEW
   ============================================================ */
.ocr-preview-area {
    display: none;
    margin: 16px;
}
.ocr-preview-area.is-visible {
    display: block;
}
.ocr-image-frame {
    min-height: 455px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-radius: 15px;
    background:
        linear-gradient(
            135deg,
            rgba(6,5,14,.72),
            rgba(15,12,28,.78)
        );
    border: 1px solid rgba(255,255,255,.05);
    overflow: hidden;
}
.ocr-image-frame img {
    display: block;
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow:
        0 18px 50px rgba(0,0,0,.35);
}
.ocr-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.045);
}
.ocr-file-name {
    overflow: hidden;
    color: #aaa4bd;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ocr-file-size {
    flex: 0 0 auto;
    color: #716b83;
    font-size: 10px;
}
/* ============================================================
   EDITOR
   ============================================================ */
.ocr-editor {
    display: flex;
    flex-direction: column;
    min-height: 510px;
}
.ocr-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
}
.ocr-textarea {
    width: 100%;
    min-height: 410px;
    flex: 1;
    resize: vertical;
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid rgba(156,137,255,.13);
    border-radius: 14px;
    outline: none;
    background:
        linear-gradient(
            145deg,
            rgba(7,6,16,.76),
            rgba(12,10,23,.90)
        );
    color: #eeeaff;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 15px;
    line-height: 1.75;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}
.ocr-textarea:focus {
    border-color: rgba(124,92,255,.46);
    box-shadow:
        0 0 0 3px rgba(124,92,255,.07),
        inset 0 1px 0 rgba(255,255,255,.02);
}
.ocr-textarea::placeholder {
    color: #575268;
}
.ocr-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 11px;
}
.ocr-stats {
    display: flex;
    gap: 15px;
    color: #6f697f;
    font-size: 10px;
}
.ocr-stat strong {
    color: #aaa4bd;
    font-weight: 700;
}
.ocr-actions {
    display: flex;
    gap: 7px;
}
.ocr-action {
    min-height: 35px;
    padding: 0 12px;
    border: 1px solid rgba(156,137,255,.14);
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    color: #aaa4bd;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease;
}
.ocr-action:hover {
    color: white;
    border-color: rgba(156,137,255,.30);
    background: rgba(124,92,255,.10);
}
.ocr-action.primary {
    color: #e9e4ff;
    background: rgba(124,92,255,.13);
    border-color: rgba(124,92,255,.27);
}
.ocr-action.danger:hover {
    color: #ff9db2;
    border-color: rgba(255,107,138,.25);
    background: rgba(255,107,138,.07);
}
/* ============================================================
   BOTTOM ACTION BAR
   ============================================================ */
.ocr-runbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 21px;
    border-top: 1px solid rgba(255,255,255,.06);
    background: rgba(7,6,15,.38);
}
.ocr-status-wrap {
    min-width: 0;
    flex: 1;
}
.ocr-status {
    color: #8d879e;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ocr-status.success {
    color: var(--ocr-success);
}
.ocr-status.error {
    color: var(--ocr-danger);
}
.ocr-progress {
    width: 100%;
    max-width: 380px;
    height: 4px;
    margin-top: 8px;
    border-radius: 99px;
    background: rgba(255,255,255,.06);
    overflow: hidden;
}
.ocr-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #6346d5,
            #9a7cff
        );
    box-shadow:
        0 0 15px rgba(124,92,255,.45);
    transition: width .2s ease;
}
.ocr-run-button {
    flex: 0 0 auto;
    min-height: 45px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid rgba(156,137,255,.35);
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            #7a59ef,
            #5d40cb
        );
    color: white;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        0 12px 30px rgba(88,62,197,.24);
    transition:
        transform .2s ease,
        filter .2s ease,
        box-shadow .2s ease;
}
.ocr-run-button:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow:
        0 16px 36px rgba(88,62,197,.34);
}
.ocr-run-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
/* ============================================================
   EMPTY / LOADED STATES
   ============================================================ */
.ocr-workspace.is-empty {
    grid-template-columns: 1fr;
}
.ocr-workspace.is-empty .ocr-panel.preview-panel {
    display: none;
}
.ocr-workspace.is-empty .ocr-panel.editor-panel {
    display: none;
}
.ocr-workspace.is-empty .ocr-panel.upload-panel {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}
/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
    .ocr-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .ocr-controls {
        width: 100%;
        justify-content: flex-start;
    }
    .ocr-workspace {
        grid-template-columns: 1fr;
    }
    .ocr-image-frame,
    .ocr-upload {
        min-height: 360px;
    }
    .ocr-textarea {
        min-height: 360px;
    }
}
@media (max-width: 640px) {
    .ocr-root {
        margin-top: 20px;
        margin-bottom: 45px;
    }
    .ocr-tool {
        border-radius: 18px;
    }
    .ocr-topbar {
        padding: 15px;
    }
    .ocr-controls {
        display: grid;
        grid-template-columns: 1fr;
    }
    .ocr-control {
        width: 100%;
        justify-content: space-between;
        box-sizing: border-box;
    }
    .ocr-control select {
        min-width: 0;
        max-width: 190px;
    }
    .ocr-workspace {
        padding: 12px;
        gap: 12px;
    }
    .ocr-upload {
        margin: 10px;
        min-height: 310px;
    }
    .ocr-upload-inner {
        padding: 20px;
    }
    .ocr-image-frame {
        min-height: 300px;
    }
    .ocr-editor {
        min-height: 400px;
    }
    .ocr-textarea {
        min-height: 300px;
        padding: 14px;
        font-size: 14px;
    }
    .ocr-editor-footer {
        align-items: flex-start;
        flex-direction: column;
    }
    .ocr-actions {
        width: 100%;
    }
    .ocr-action {
        flex: 1;
    }
    .ocr-runbar {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }
    .ocr-progress {
        max-width: none;
    }
    .ocr-run-button {
        width: 100%;
    }
}
