/**
 * Frontend Public Styles for ShorthandGuru Multi-Exam Tests
 * Designed by ShorthandGuru.com Shivam Singh
 */

/* 1. Custom Font Definitions 
   NOTE: If you ever change the font location in the future, you can simply change the URL below.
*/
@font-face {
    font-family: 'Kruti Dev 010';
    src: local('Kruti Dev 010'), 
         url('https://shorthandguru.com/wp-content/uploads/krutidev010.ttf') format('truetype'),
         url('../fonts/krutidev010.ttf') format('truetype'),
         url('https://uppscaps.com/wp-content/uploads/krutidev010.ttf') format('truetype');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

.font-krutidev {
    font-family: 'Kruti Dev 010', -apple-system, sans-serif !important;
}

.font-mangal {
    font-family: 'Mangal', 'Noto Sans Devanagari', -apple-system, sans-serif !important;
}

/* 2. Category Navigation Tabs for [sg_all_exams] */
.sg-all-exams-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.sg-tabs-nav {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
    padding: 10px 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

.sg-tab-btn {
    padding: 11px 22px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    outline: none !important;
    text-decoration: none !important;
}

.sg-tab-btn:hover {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06) !important;
}

.sg-tab-btn.sg-tab-active {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    border-color: #4338ca !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

.sg-tab-btn.sg-tab-active .dashicons {
    color: #ffffff !important;
}

.sg-tab-pane {
    display: none !important;
}

.sg-tab-pane.sg-tab-pane-active {
    display: block !important;
    animation: sgFadeIn 0.25s ease !important;
}

@keyframes sgFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 3. Container & Header */
.sg-exam-container {
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
}

.sg-exam-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.sg-exam-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.sg-exam-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-exam-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #4f46e5;
}

.sg-total-badge {
    background: #eef2ff;
    color: #4f46e5;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e0e7ff;
}

.sg-exam-desc {
    margin: 10px 0 16px 0;
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
}

/* Beautiful Search Bar with Rounded Full Pill Design */
.sg-search-wrap {
    margin-top: 18px;
}

.sg-search-inner {
    position: relative;
    max-width: 540px;
}

.sg-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6366f1;
    font-size: 20px;
    pointer-events: none;
}

.sg-live-filter-input {
    width: 100%;
    padding: 12px 18px 12px 46px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.sg-live-filter-input:focus {
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.sg-live-filter-input::placeholder {
    color: #94a3b8;
}

/* 3. Colorful Cards Grid with Rounded Corners */
.sg-tests-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 24px !important;
}

.sg-test-card {
    background: #ffffff !important;
    border-radius: 18px !important;
    padding: 22px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.sg-test-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 28px -6px rgba(15, 23, 42, 0.12) !important;
}

/* Colorful Card Theme Variants (Top Accent Stripe & Subtle Gradients) */
.sg-test-card.sg-theme-indigo {
    border-top: 5px solid #4f46e5 !important;
    background: linear-gradient(180deg, #f5f7ff 0%, #ffffff 80px) !important;
}
.sg-test-card.sg-theme-indigo:hover {
    border-color: #c7d2fe !important;
    border-top-color: #4338ca !important;
    box-shadow: 0 16px 28px -6px rgba(79, 70, 229, 0.2) !important;
}

.sg-test-card.sg-theme-emerald {
    border-top: 5px solid #10b981 !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 80px) !important;
}
.sg-test-card.sg-theme-emerald:hover {
    border-color: #a7f3d0 !important;
    border-top-color: #059669 !important;
    box-shadow: 0 16px 28px -6px rgba(16, 185, 129, 0.2) !important;
}

.sg-test-card.sg-theme-violet {
    border-top: 5px solid #8b5cf6 !important;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 80px) !important;
}
.sg-test-card.sg-theme-violet:hover {
    border-color: #ddd6fe !important;
    border-top-color: #7c3aed !important;
    box-shadow: 0 16px 28px -6px rgba(139, 92, 246, 0.2) !important;
}

.sg-test-card.sg-theme-amber {
    border-top: 5px solid #f59e0b !important;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 80px) !important;
}
.sg-test-card.sg-theme-amber:hover {
    border-color: #fde68a !important;
    border-top-color: #d97706 !important;
    box-shadow: 0 16px 28px -6px rgba(245, 158, 11, 0.2) !important;
}

.sg-test-card.sg-theme-rose {
    border-top: 5px solid #f43f5e !important;
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 80px) !important;
}
.sg-test-card.sg-theme-rose:hover {
    border-color: #fecdd3 !important;
    border-top-color: #e11d48 !important;
    box-shadow: 0 16px 28px -6px rgba(244, 63, 94, 0.2) !important;
}

.sg-test-card.sg-theme-sky {
    border-top: 5px solid #0284c7 !important;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 80px) !important;
}
.sg-test-card.sg-theme-sky:hover {
    border-color: #bae6fd !important;
    border-top-color: #0369a1 !important;
    box-shadow: 0 16px 28px -6px rgba(2, 132, 199, 0.2) !important;
}

/* Card Header Badges Row */
.sg-card-badges-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 14px !important;
}

.sg-badges-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

/* FREE and PAID Badges */
.sg-badge-access {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 3px 10px !important;
    border-radius: 9999px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.sg-badge-access .dashicons {
    font-size: 13px !important;
    width: 13px !important;
    height: 13px !important;
    line-height: 13px !important;
}

.sg-badge-free {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
}

.sg-badge-paid {
    background: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fde68a !important;
}

/* WPM Badge */
.sg-badge-wpm {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
    padding: 3px 10px !important;
    border-radius: 9999px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border: 1px solid #cbd5e1 !important;
}

.sg-badge-wpm .dashicons {
    font-size: 13px !important;
    width: 13px !important;
    height: 13px !important;
    line-height: 13px !important;
    color: #64748b !important;
}

.sg-theme-indigo .sg-badge-wpm {
    background: #eef2ff !important;
    color: #4338ca !important;
    border-color: #c7d2fe !important;
}
.sg-theme-emerald .sg-badge-wpm {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
}
.sg-theme-violet .sg-badge-wpm {
    background: #f5f3ff !important;
    color: #6d28d9 !important;
    border-color: #ddd6fe !important;
}
.sg-theme-amber .sg-badge-wpm {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}
.sg-theme-rose .sg-badge-wpm {
    background: #fff1f2 !important;
    color: #be123c !important;
    border-color: #fecdd3 !important;
}
.sg-theme-sky .sg-badge-wpm {
    background: #f0f9ff !important;
    color: #0369a1 !important;
    border-color: #bae6fd !important;
}

.sg-card-title-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.sg-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.45;
}

.sg-badge-new {
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.sg-card-topic {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 9999px;
    margin-top: 8px;
}

.sg-card-topic .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    line-height: 13px;
}

.sg-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    padding: 12px 0;
    border-top: 1px dashed #e2e8f0;
    border-bottom: 1px dashed #e2e8f0;
}

.sg-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.sg-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    color: #64748b;
}

.sg-font-tag {
    background: #f1f5f9;
    color: #334155;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.sg-card-footer {
    margin-top: 10px;
}

.sg-btn-attempt,
a.sg-btn-attempt,
.sg-test-card .sg-btn-attempt,
.sg-test-card a.sg-btn-attempt {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
    border: none !important;
    cursor: pointer !important;
}

.sg-btn-attempt:hover,
a.sg-btn-attempt:hover,
.sg-test-card .sg-btn-attempt:hover,
.sg-test-card a.sg-btn-attempt:hover {
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
    color: #ffffff !important;
}

.sg-theme-emerald .sg-btn-attempt,
.sg-theme-emerald a.sg-btn-attempt,
.sg-test-card.sg-theme-emerald .sg-btn-attempt,
.sg-test-card.sg-theme-emerald a.sg-btn-attempt {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    color: #ffffff !important;
}
.sg-theme-emerald .sg-btn-attempt:hover,
.sg-theme-emerald a.sg-btn-attempt:hover,
.sg-test-card.sg-theme-emerald .sg-btn-attempt:hover,
.sg-test-card.sg-theme-emerald a.sg-btn-attempt:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45) !important;
    color: #ffffff !important;
}

.sg-theme-violet .sg-btn-attempt,
.sg-theme-violet a.sg-btn-attempt,
.sg-test-card.sg-theme-violet .sg-btn-attempt,
.sg-test-card.sg-theme-violet a.sg-btn-attempt {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
    color: #ffffff !important;
}
.sg-theme-violet .sg-btn-attempt:hover,
.sg-theme-violet a.sg-btn-attempt:hover,
.sg-test-card.sg-theme-violet .sg-btn-attempt:hover,
.sg-test-card.sg-theme-violet a.sg-btn-attempt:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%) !important;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45) !important;
    color: #ffffff !important;
}

.sg-theme-amber .sg-btn-attempt,
.sg-theme-amber a.sg-btn-attempt,
.sg-test-card.sg-theme-amber .sg-btn-attempt,
.sg-test-card.sg-theme-amber a.sg-btn-attempt {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
    color: #ffffff !important;
}
.sg-theme-amber .sg-btn-attempt:hover,
.sg-theme-amber a.sg-btn-attempt:hover,
.sg-test-card.sg-theme-amber .sg-btn-attempt:hover,
.sg-test-card.sg-theme-amber a.sg-btn-attempt:hover {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45) !important;
    color: #ffffff !important;
}

.sg-theme-rose .sg-btn-attempt,
.sg-theme-rose a.sg-btn-attempt,
.sg-test-card.sg-theme-rose .sg-btn-attempt,
.sg-test-card.sg-theme-rose a.sg-btn-attempt {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%) !important;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3) !important;
    color: #ffffff !important;
}
.sg-theme-rose .sg-btn-attempt:hover,
.sg-theme-rose a.sg-btn-attempt:hover,
.sg-test-card.sg-theme-rose .sg-btn-attempt:hover,
.sg-test-card.sg-theme-rose a.sg-btn-attempt:hover {
    background: linear-gradient(135deg, #be123c 0%, #e11d48 100%) !important;
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.45) !important;
    color: #ffffff !important;
}

.sg-theme-sky .sg-btn-attempt,
.sg-theme-sky a.sg-btn-attempt,
.sg-test-card.sg-theme-sky .sg-btn-attempt,
.sg-test-card.sg-theme-sky a.sg-btn-attempt {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%) !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
    color: #ffffff !important;
}
.sg-theme-sky .sg-btn-attempt:hover,
.sg-theme-sky a.sg-btn-attempt:hover,
.sg-test-card.sg-theme-sky .sg-btn-attempt:hover,
.sg-test-card.sg-theme-sky a.sg-btn-attempt:hover {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%) !important;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45) !important;
    color: #ffffff !important;
}

.sg-no-tests-msg {
    grid-column: 1 / -1;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-size: 15px;
}

/* Highlighted Audio Dictation Notice Box */
.sg-dictation-notice-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fde68a;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.08);
}

.sg-dictation-notice-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #d97706;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.sg-dictation-notice-icon .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
}

.sg-dictation-notice-text {
    font-size: 15px;
    font-weight: 700;
    color: #92400e;
    line-height: 1.5;
}

/* 4. Test Player Layout */
.sg-player-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin: 30px auto;
    max-width: 1200px;
}

.sg-back-bar {
    margin-bottom: 16px;
}

.sg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0284c7 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
}

.sg-player-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.sg-player-title {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.sg-player-topic {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #0284c7;
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 4px;
}

.sg-instructions-alert {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #92400e;
    margin-top: 14px;
}

.sg-embed-container {
    margin-bottom: 20px;
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* Toolbar */
.sg-player-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 18px;
}

.sg-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-toolbar-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.sg-tool-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sg-tool-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.sg-tool-btn.sg-active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.sg-ctrl-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sg-ctrl-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.sg-ctrl-toggle-btn .sg-ctrl-icon {
    font-size: 14px;
    line-height: 1;
}

.sg-ctrl-toggle-btn.sg-ctrl-locked {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.sg-ctrl-toggle-btn.sg-ctrl-locked:hover {
    background: #fecaca !important;
    border-color: #dc2626 !important;
}

.sg-ctrl-blocked-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #dc2626;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
    z-index: 10;
    pointer-events: none;
    animation: sgFadeInUp 0.2s ease-out;
}

@keyframes sgFadeInUp {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.sg-size-val {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    min-width: 38px;
    text-align: center;
}

/* Timer & Action Buttons */
.sg-timer-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.sg-timer-display .dashicons {
    color: #0284c7;
}

.sg-btn-start {
    background: #16a34a;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
}

.sg-btn-start:hover {
    background: #15803d;
}

.sg-btn-submit {
    background: #dc2626;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
}

.sg-btn-submit:hover {
    background: #b91c1c;
}

/* 5. Main Typing Stage: Side-by-Side Mode */
.sg-player-stage {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.sg-stage-left {
    min-width: 0;
}

.sg-stage-right {
    flex: 1;
    min-width: 0;
}

.sg-outline-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sg-outline-header {
    background: #f1f5f9;
    padding: 8px 12px;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sg-img-zoom-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0;
}

.sg-outline-img-wrap {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    text-align: center;
    background: #fafafa;
}

.sg-outline-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.sg-textarea-wrap {
    position: relative;
}

.sg-candidate-textarea {
    width: 100%;
    min-height: 350px;
    padding: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    line-height: 1.8;
    color: #0f172a;
    background: #ffffff;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.sg-candidate-textarea:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.sg-candidate-textarea:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.sg-typing-stats-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}

/* Responsive Stacking for Side-by-Side on Mobile */
@media (max-width: 768px) {
    .sg-player-stage {
        flex-direction: column;
    }
    .sg-stage-left {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* 6. Evaluation Loading Spinner */
.sg-eval-loading {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 20px;
}

.sg-spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0284c7;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    animation: sgSpin 0.9s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes sgSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 7. Results Section */
.sg-result-container {
    margin-top: 30px;
    border-top: 2px solid #e2e8f0;
    padding-top: 24px;
}

.sg-qualification-banner {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.sg-qualified-true {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.sg-qualified-false {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.sg-qual-status {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-qual-score {
    font-size: 16px;
    font-weight: 600;
}

/* Result Stats Tiles */
.sg-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.sg-stat-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.sg-stat-val {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.sg-stat-lbl {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Comparison Boxes */
.sg-comparison-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .sg-comparison-wrapper {
        grid-template-columns: 1fr;
    }
}

.sg-comp-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.sg-comp-header {
    background: #f1f5f9;
    padding: 10px 14px;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 700;
    font-size: 14px;
    color: #334155;
}

.sg-comp-content {
    padding: 16px;
    max-height: 320px;
    overflow-y: auto;
    font-size: 17px;
    line-height: 2;
    background: #fafafa;
}

/* Word Highlights - Supporting all class names with high priority */
.sg-comp-content span.sg-hl-correct,
.sg-comp-content span.hssg-pro-hl-correct,
.sg-comp-content span.sg-diff-correct {
    color: #16a34a !important;
    font-weight: 500 !important;
}

.sg-comp-content span.sg-hl-full-error,
.sg-comp-content span.hssg-pro-hl-full-error,
.sg-comp-content span.sg-diff-wrong {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    display: inline-block !important;
    margin: 1px !important;
    border: 1px solid #fca5a5 !important;
}

.sg-comp-content span.sg-hl-half-error,
.sg-comp-content span.hssg-pro-hl-half-error,
.sg-comp-content span.sg-diff-half {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    display: inline-block !important;
    margin: 1px !important;
    border-bottom: 2px dashed #6366f1 !important;
}

.sg-comp-content span.sg-hl-missing,
.sg-comp-content span.hssg-pro-hl-missing,
.sg-comp-content span.sg-diff-missing {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-style: normal !important;
    text-decoration: line-through !important;
    display: inline-block !important;
    margin: 1px !important;
}

.sg-comp-content span.sg-diff-extra,
.sg-comp-content span.hssg-pro-hl-extra {
    background-color: #fef3c7 !important;
    color: #d97706 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    display: inline-block !important;
    margin: 1px !important;
}

/* ShorthandGuru Result Brand & Actions Bar directly above Detailed Mistakes Breakdown */
.sg-result-actions-card {
    margin: 28px 0 18px 0 !important;
    padding: 16px 20px !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 14px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

.sg-result-branding-line {
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.sg-result-branding-line .dashicons {
    color: #4f46e5 !important;
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
}

.sg-result-btn-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.sg-btn-pdf-result {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    outline: none !important;
}

.sg-btn-pdf-result:hover {
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4) !important;
}

.sg-btn-restart {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    text-decoration: none !important;
}

.sg-btn-restart:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
}

.sg-breakdown-heading {
    margin: 20px 0 12px 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.sg-breakdown-heading .dashicons {
    color: #4f46e5 !important;
}

/* Mistakes Table */
.sg-mistakes-table-wrap {
    margin-top: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.sg-mistakes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.sg-mistakes-table th {
    background: #f8fafc;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    color: #334155;
}

.sg-mistakes-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.sg-mistakes-table tr:hover {
    background: #f8fafc;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .sg-result-container,
    .sg-result-container * {
        visibility: visible;
    }
    .sg-result-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .sg-no-print {
        display: none !important;
    }
}
