/* =========================================================
   Screenshot to Clean Notes Tool - Styles
   Matches site theme from styles.css
   ========================================================= */

/* =========================================================
   THREE.JS CANVAS BACKGROUND
   ========================================================= */
#heroCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
}

/* =========================================================
   MAIN TOOL WRAPPER
   ========================================================= */
.tool-screenshot-notes {
    min-height: 100vh;
    position: relative;
}

/* =========================================================
   TOOL HEADER
   ========================================================= */
.tool-header {
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    position: sticky;
    top: 0;
    z-index: 30;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.breadcrumb a {
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    text-decoration: none;
    transition: color var(--transition-fast, 200ms);
}

.breadcrumb a:hover {
    color: var(--text-main, #041317);
}

.breadcrumb .separator {
    color: rgba(148, 163, 184, 0.6);
}

.breadcrumb .current {
    color: var(--text-main, #041317);
    font-weight: 600;
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.stn-hero {
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.stn-hero-content {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 32px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg, 28px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft, 0 18px 50px rgba(15, 23, 42, 0.32));
}

.stn-hero-title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main, #041317);
    line-height: 1.1;
}

.stn-hero-subtitle {
    margin: 0 0 24px;
    font-size: 1.1rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
}

.stn-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.stn-trust-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    margin: 0;
}

.stn-trust-line .trust-icon {
    width: 18px;
    height: 18px;
    color: var(--accent, #22c55e);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.tool-main {
    padding: 40px 0 80px;
}

.stn-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .stn-layout {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CARD STYLES
   ========================================================= */
.stn-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-lg, 28px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-small, 0 12px 28px rgba(15, 23, 42, 0.18));
    overflow: hidden;
}

.stn-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.03), transparent);
}

.stn-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.stn-card-body {
    padding: 22px;
}

/* =========================================================
   DROPZONE
   ========================================================= */
.stn-dropzone {
    border: 2px dashed rgba(148, 163, 184, 0.5);
    border-radius: var(--radius-xl, 24px);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-med, 300ms);
    background: rgba(248, 250, 252, 0.5);
}

.stn-dropzone:hover,
.stn-dropzone:focus {
    border-color: var(--accent, #22c55e);
    background: rgba(187, 247, 208, 0.15);
    outline: none;
}

.stn-dropzone.dragover {
    border-color: var(--accent, #22c55e);
    background: rgba(187, 247, 208, 0.25);
    transform: scale(1.01);
}

.stn-dropzone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--accent, #22c55e);
    opacity: 0.8;
}

.stn-dropzone-text {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main, #041317);
}

.stn-dropzone-subtext {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
}

.stn-dropzone-formats {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.9);
}

/* =========================================================
   PASTE BUTTON
   ========================================================= */
.stn-paste-btn {
    width: 100%;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stn-paste-btn svg {
    width: 18px;
    height: 18px;
}

/* =========================================================
   IMAGE PREVIEW
   ========================================================= */
.stn-preview {
    margin-top: 20px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-xl, 24px);
    overflow: hidden;
    background: #f8fafc;
}

.stn-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.stn-file-info {
    flex: 1;
    min-width: 0;
}

.stn-file-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stn-file-meta {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
}

.stn-preview-image {
    padding: 12px;
    text-align: center;
    max-height: 300px;
    overflow: auto;
}

.stn-preview-image img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 12px;
}

/* =========================================================
   OCR SETTINGS
   ========================================================= */
.stn-settings-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.stn-settings-title {
    margin: 0 0 16px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
}

.stn-setting-row {
    margin-bottom: 16px;
}

.stn-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main, #041317);
}

.stn-select {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color var(--transition-fast, 200ms);
}

.stn-select:hover,
.stn-select:focus {
    border-color: var(--accent, #22c55e);
    outline: none;
}

.stn-radio-group {
    display: flex;
    gap: 16px;
}

.stn-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.stn-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #22c55e);
}

.stn-extract-btn {
    width: 100%;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
}

.stn-extract-btn svg {
    width: 20px;
    height: 20px;
}

/* =========================================================
   PROGRESS BAR
   ========================================================= */
.stn-progress {
    margin-top: 20px;
}

.stn-progress-bar {
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.stn-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bg-1, #8ef3c0), var(--accent, #22c55e), var(--bg-2, #22d3ee));
    border-radius: 999px;
    transition: width 150ms ease-out;
}

.stn-progress-text {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    text-align: center;
}

/* =========================================================
   OUTPUT PANEL
   ========================================================= */
.stn-tabs {
    display: flex;
    gap: 4px;
}

.stn-tab {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    border-radius: var(--radius-pill, 999px);
    cursor: pointer;
    transition: all var(--transition-fast, 200ms);
}

.stn-tab:hover {
    background: rgba(148, 163, 184, 0.15);
}

.stn-tab.active {
    background: var(--accent, #22c55e);
    color: var(--accent-dark, #022c22);
}

/* Empty State */
.stn-output-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
}

.stn-output-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.stn-output-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Controls */
.stn-output-controls {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.stn-control-row {
    margin-bottom: 14px;
}

.stn-toggle-row {
    margin-bottom: 10px;
}

.stn-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.stn-toggle input {
    display: none;
}

.stn-toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    position: relative;
    transition: background var(--transition-fast, 200ms);
}

.stn-toggle-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-fast, 200ms);
}

.stn-toggle input:checked+.stn-toggle-slider {
    background: var(--accent, #22c55e);
}

.stn-toggle input:checked+.stn-toggle-slider::after {
    transform: translateX(20px);
}

.stn-toggle-label {
    font-size: 0.9rem;
    color: var(--text-main, #041317);
}

/* Textarea */
.stn-textarea {
    width: 100%;
    min-height: 280px;
    padding: 16px;
    font-family: "Monaco", "Consolas", "Courier New", monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 16px;
    background: #fafbfc;
    resize: vertical;
    transition: border-color var(--transition-fast, 200ms);
}

.stn-textarea:focus {
    outline: none;
    border-color: var(--accent, #22c55e);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Action Buttons */
.stn-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.stn-action-buttons .btn {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stn-action-buttons .btn svg {
    width: 18px;
    height: 18px;
}

/* =========================================================
   HOW IT WORKS SECTION
   ========================================================= */
.stn-how-it-works {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.stn-section-title {
    margin: 0 0 32px;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    color: var(--text-main, #041317);
}

.stn-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .stn-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .stn-steps {
        grid-template-columns: 1fr;
    }
}

.stn-step {
    text-align: center;
    padding: 24px 18px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl, 24px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.stn-step-number {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-dark, #022c22);
    background: linear-gradient(135deg, var(--bg-1, #8ef3c0), var(--accent, #22c55e));
    border-radius: 50%;
}

.stn-step h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

.stn-step p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    line-height: 1.5;
}

/* =========================================================
   FAQ SECTION
   ========================================================= */
.stn-faq {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.stn-faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.stn-faq-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 12px;
    overflow: hidden;
}

.stn-faq-item summary {
    padding: 18px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stn-faq-item summary::-webkit-details-marker {
    display: none;
}

.stn-faq-item summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--accent, #22c55e);
    transition: transform var(--transition-fast, 200ms);
}

.stn-faq-item[open] summary::after {
    transform: rotate(45deg);
}

.stn-faq-item p {
    margin: 0;
    padding: 0 22px 18px;
    font-size: 0.92rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    line-height: 1.6;
}

/* =========================================================
   FOOTER
   ========================================================= */
.tool-footer {
    padding: 32px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-content p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
}

.footer-content a {
    color: var(--text-main, #041317);
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

.footer-nav {
    display: flex;
    gap: 20px;
    font-size: 0.88rem;
}

.footer-nav a {
    color: var(--text-muted, rgba(4, 19, 23, 0.78));
    text-decoration: none;
    transition: color var(--transition-fast, 200ms);
}

.footer-nav a:hover {
    color: var(--text-main, #041317);
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
.stn-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stn-toast {
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    border-radius: 12px;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: slideInRight 300ms ease-out;
}

.stn-toast.success {
    background: linear-gradient(135deg, #166534, #22c55e);
}

.stn-toast.error {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =========================================================
   BUTTON OVERRIDES
   ========================================================= */
.btn.small {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn.danger {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.3);
}

.btn.danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.97);
    color: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn.secondary:hover {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.7);
}

/* =========================================================
   REDUCED MOTION SUPPORT
   ========================================================= */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 600px) {
    .stn-hero {
        padding: 60px 0 40px;
    }

    .stn-hero-content {
        padding: 28px 20px;
    }

    .stn-hero-title {
        font-size: 1.8rem;
    }

    .stn-hero-subtitle {
        font-size: 1rem;
    }

    .stn-hero-actions {
        flex-direction: column;
    }

    .stn-hero-actions .btn {
        width: 100%;
    }

    .stn-card-body {
        padding: 18px;
    }

    .stn-dropzone {
        padding: 36px 18px;
    }

    .stn-action-buttons {
        flex-direction: column;
    }

    .stn-action-buttons .btn {
        min-width: auto;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}