@import "../../style.css";

/* YouTube Transkrip specific styles */

.transkrip-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.input-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
    width: 100%;
}

.input-field-wrap {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    height: 52px;
    padding: 0 8px 0 16px;
    gap: 12px;
    transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
    flex: 1;
    min-width: 0;
}

.input-field-wrap:focus-within {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    background: var(--surface);
}

.input-field-wrap .input-icon {
    position: static;
    transform: none;
    color: #ef4444;
    font-size: 1.35rem;
    pointer-events: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.url-input {
    flex: 1;
    height: 100%;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 0;
    box-shadow: none !important;
}

.url-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.btn-paste {
    position: static;
    transform: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.btn-paste:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
}

.btn-submit {
    height: 52px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: none;
    padding: 0 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

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

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Example chips */
.example-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Video and player section */
.video-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media (min-width: 768px) {
    .video-section.has-video {
        grid-template-columns: 360px 1fr;
    }
}

.player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #000;
    box-shadow: var(--shadow-sm);
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.video-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.video-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Language selector */
.lang-selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.lang-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.lang-select:focus {
    border-color: #ef4444;
}

/* Transcript container & controls */
.transcript-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-top: 24px;
    display: none;
}

.transcript-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: var(--surface-2);
}

.transcript-header-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.transcript-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-action {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-action.btn-ai {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    border-color: var(--accent);
    color: var(--accent);
}

.btn-action.btn-ai:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
}

/* Search bar */
.search-bar-wrap {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
}

.search-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Transcript list */
.transcript-list {
    max-height: 480px;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transcript-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.15s;
    cursor: pointer;
}

.transcript-item:hover {
    background: var(--surface-2);
}

.transcript-time {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.transcript-item:hover .transcript-time {
    background: #ef4444;
    color: #ffffff;
}

.transcript-text {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-primary);
}

.highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 3px;
}

body.dark .highlight {
    background: #854d0e;
    color: #fef08a;
}

/* Loading state */
.loading-box {
    display: none;
    text-align: center;
    padding: 36px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid rgba(239, 68, 68, 0.2);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert / notification toast */
.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.toast-msg.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Error banner */
.error-banner {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 18px;
    font-size: 0.9rem;
    align-items: flex-start;
    gap: 12px;
}

body.dark .error-banner {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 640px) {
    .transkrip-box {
        padding: 20px 16px;
    }

    .input-form {
        flex-direction: column;
        gap: 12px;
    }

    .input-field-wrap {
        height: 50px;
        padding: 0 8px 0 14px;
        gap: 10px;
    }

    .url-input {
        font-size: 0.9rem;
    }

    .btn-submit {
        width: 100%;
        height: 48px;
    }

    .example-chips {
        margin-top: 14px;
        gap: 6px;
    }

    .example-chips > span:first-child {
        width: 100%;
        margin-bottom: 2px;
        font-size: 0.8rem;
    }

    .chip {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .transcript-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .transcript-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .btn-action {
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .btn-action.btn-ai {
        grid-column: span 2;
    }

    .search-bar-wrap {
        padding: 10px 16px;
    }

    .transcript-list {
        padding: 12px 14px;
        max-height: 380px;
    }

    .transcript-item {
        padding: 8px;
        gap: 10px;
    }

    .transcript-text {
        font-size: 0.88rem;
    }
}

