/**
 * Short Circuit Student Portal CSS
 * Premium dark mode styling using Inter and Outfit fonts, smooth gradients, and glassmorphic panels.
 * Prefix: sc-
 */

:root {
    --sc-bg: #0F131E;
    --sc-card-bg: rgba(22, 26, 33, 0.85);
    --sc-card-border: rgba(255, 255, 255, 0.08);
    --sc-primary: #2393A2;
    --sc-primary-hover: #1c7c89;
    --sc-accent: #10b981;
    --sc-text-main: #FFFFFF;
    --sc-text-muted: #9ca3af;
    --sc-input-bg: #1f2937;
    --sc-input-border: #374151;
    --sc-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --sc-radius: 12px;
}

/* Course page (light panels) overrides using provided palette:
   Palette: #0F131E (dark text/background accents), #2393A2 (primary),
   #FFFFFF (white), #2C3259, #05375D
*/
.sc-course-page {
    --sc-bg: #f6f8fb; /* light page background */
    --sc-card-bg: #ffffff; /* white panels */
    --sc-card-border: rgba(44,50,89,0.06);
    --sc-primary: #2393A2;
    --sc-primary-hover: #05375D;
    --sc-accent: #2393A2;
    --sc-text-main: #0F131E;
    --sc-text-muted: #2C3259;
    --sc-input-bg: #f3f6fb;
    --sc-input-border: rgba(44,50,89,0.08);
    --sc-shadow: 0 6px 20px rgba(15,19,30,0.06);
}

/* Base Wrapper */
.sc-portal-wrapper {
    background-color: var(--sc-bg);
    color: var(--sc-text-main);
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 30px;
    border-radius: var(--sc-radius);
    max-width: 1200px;
    margin: 20px auto;
    box-shadow: var(--sc-shadow);
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

.sc-portal-wrapper h1, 
.sc-portal-wrapper h2, 
.sc-portal-wrapper h3, 
.sc-portal-wrapper h4 {
    font-family: 'Quicksand', sans-serif;
    color: #ffffff;
    font-weight: 700;
}

/* Header & Streaks */
.sc-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--sc-card-border);
    padding-bottom: 20px;
    margin-bottom: 30px;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.sc-welcome h1 {
    margin: 0;
    font-size: 2.2rem;
}
.sc-welcome p {
    margin: 5px 0 0 0;
    color: var(--sc-text-muted);
}

.sc-streak-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    padding: 10px 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    font-family: 'Quicksand', sans-serif;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

/* Stats Grid */
.sc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.sc-stat-card {
    background: var(--sc-card-bg);
    border-radius: 0 !important;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--sc-shadow);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.sc-stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
}

.sc-stat-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.sc-stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Quicksand', sans-serif;
    color: #ffffff;
    line-height: 1.1;
}

.sc-stat-label {
    color: var(--sc-text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Layout Panels */
.sc-dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.sc-learning-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: flex-start;
}

.sc-learning-main-col,
.sc-learning-sidebar-col {
    width: 100%;
}

.sc-learning-sidebar-col {
    display: grid;
    gap: 24px;
}

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

.sc-panel {
    background: var(--sc-card-bg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--sc-shadow);
    backdrop-filter: blur(10px);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.sc-panel-title {
    margin-top: 0;
    font-size: 1.4rem;
    border-bottom: 1px solid var(--sc-card-border);
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Projects Panel */
.sc-projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sc-project-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sc-card-border);
    border-radius: var(--sc-radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.sc-project-info {
    flex: 1;
    min-width: 250px;
}

.sc-project-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

/* Progress bar */
.sc-progress-bar-wrapper {
    background: var(--sc-input-bg);
    border-radius: 10px;
    height: 10px;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    margin-bottom: 6px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.sc-progress-bar {
    background: linear-gradient(90deg, var(--sc-primary), var(--sc-accent));
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.sc-progress-text {
    font-size: 0.85rem;
    color: var(--sc-text-muted);
}

/* Buttons */
.sc-btn {
    background: #2393A2;
    color: #ffffff !important;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    padding: 10px 22px;
    text-decoration: none !important;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(35, 147, 162, 0.3);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.sc-btn:hover {
    background: #1c7c89;
    transform: translateY(-1px);
}

.sc-btn-secondary {
    background: transparent;
    border: 1px solid var(--sc-card-border);
    color: var(--sc-text-main) !important;
    box-shadow: none;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.sc-btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--sc-text-muted);
}

.sc-btn-disabled {
    background: var(--sc-input-bg);
    color: var(--sc-text-muted) !important;
    cursor: not-allowed;
    box-shadow: none;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.sc-btn-disabled:hover {
    transform: none;
    background: var(--sc-input-bg);
}

/* Empty State */
.sc-empty-state {
    text-align: center;
    padding: 40px 20px;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.sc-empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
}

.sc-empty-state p {
    color: var(--sc-text-muted);
    margin-bottom: 25px;
}

/* Recent Activity List */
.sc-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 3px solid var(--sc-primary);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.sc-activity-item.type-quiz {
    border-left-color: var(--sc-accent);
}

.sc-activity-meta {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--sc-text-muted);
}

/* WooCommerce Orders Table */
.sc-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.sc-orders-table th, 
.sc-orders-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--sc-card-border);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.sc-orders-table th {
    font-family: 'Quicksand', sans-serif;
    color: #ffffff;
    font-weight: 600;
}

/* Support Tickets Table */
.sc-tickets-table {
    width: 100%;
    border-collapse: collapse;
}

.sc-tickets-table th, 
.sc-tickets-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--sc-card-border);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.sc-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

.sc-badge.status-open {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sc-badge.status-replied {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.sc-badge.status-closed {
    background-color: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

/* Forms & Inputs */
.sc-form-group {
    margin-bottom: 20px;
}

.sc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--sc-text-main);
}

input.sc-input {
    border: none !important;
    background-color: #1f2937 !important;
}

.sc-input, 
.sc-textarea {
    width: 100%;
    background: var(--sc-input-bg);
    border: 0px solid var(--sc-input-border);
    color: #ffffff !important;
    padding: 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.sc-input::placeholder,
.sc-textarea::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

.sc-input:focus, 
.sc-textarea:focus {
    outline: none;
    border-color: var(--sc-primary);
}

/* Logout panel */
.sc-logout-panel {
    padding: 18px 20px;
    margin-top: 20px;
    text-align: left;
    box-shadow: var(--sc-shadow);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.sc-btn-logout {
    background: #e53935 !important;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.28);
}

.sc-btn-logout:hover {
    background: #c62828 !important;
}

/* Chat bubble styling for tickets */
.sc-chat-history {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #0b0e17;
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--sc-card-border);
    margin-bottom: 20px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.2);
}

.sc-chat-message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    animation: scFadeIn 0.3s ease-out;
}

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

.sc-chat-message.student-reply {
    align-self: flex-end;
}

.sc-chat-message.admin-reply {
    align-self: flex-start;
}

.sc-chat-bubble {
    padding: 14px 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
}

.sc-chat-message.student-reply .sc-chat-bubble {
    background: linear-gradient(135deg, var(--sc-primary, #3b82f6), var(--sc-primary-hover, #2563eb));
    color: #ffffff;
    border-radius: 20px 20px 4px 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.sc-chat-message.admin-reply .sc-chat-bubble {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    border-radius: 20px 20px 20px 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sc-chat-message.admin-reply .sc-chat-bubble::after,
.sc-chat-message.student-reply .sc-chat-bubble::after,
.sc-chat-bubble::after {
    display: none !important;
    content: none !important;
}

.sc-chat-time {
    font-size: 0.75rem;
    color: var(--sc-text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.sc-chat-message.student-reply .sc-chat-time {
    align-self: flex-end;
}

.sc-chat-message.admin-reply .sc-chat-time {
    align-self: flex-start;
}

/* Submissions Panel within Single Course */
.sc-submission-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--sc-card-border);
    padding: 20px;
    border-radius: var(--sc-radius);
    margin-top: 30px;
}

.sc-file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.sc-file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* Course Lesson Navigation Sidebar */
.sc-course-container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
}

@media (max-width: 768px) {
    .sc-course-container {
        grid-template-columns: 1fr;
    }
}

.sc-course-sidebar {
    background: var(--sc-card-bg);
    border: 1px solid var(--sc-card-border);
    border-radius: var(--sc-radius);
    padding: 20px;
    box-shadow: var(--sc-shadow);
    backdrop-filter: blur(10px);
}

.sc-sidebar-module {
    margin-bottom: 20px;
}

.sc-sidebar-module-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    color: var(--sc-primary);
}

.sc-sidebar-lessons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sc-sidebar-lessons-list li {
    margin-bottom: 8px;
}

.sc-sidebar-lessons-list a {
    color: var(--sc-text-muted);
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem;
}

.sc-sidebar-lessons-list a:hover,
.sc-sidebar-lessons-list li.active a {
    background: rgba(59, 130, 246, 0.1);
    color: #ffffff;
}

.sc-sidebar-lessons-list li.completed a {
    border-right: 3px solid var(--sc-accent);
}

/* Video embed container */
.sc-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--sc-radius);
    margin-bottom: 25px;
    border: 1px solid var(--sc-card-border);
    background: #000000;
}

.sc-video-container iframe, 
.sc-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Quiz Styles */
.sc-quiz-card {
    background: var(--sc-card-bg);
    border: 1px solid var(--sc-card-border);
    border-radius: var(--sc-radius);
    padding: 30px;
    margin-top: 35px;
}

.sc-quiz-question {
    border-bottom: 1px solid var(--sc-card-border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.sc-quiz-question:last-child {
    border-bottom: none;
}

.sc-quiz-question h5 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    margin: 0 0 15px 0;
    color: #ffffff;
}

.sc-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-quiz-option-label {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sc-card-border);
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s, border-color 0.2s;
}

.sc-quiz-option-label:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
}

.sc-quiz-option-label input[type=radio] {
    margin: 0;
}

.sc-quiz-result {
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    font-weight: 600;
}

.sc-quiz-result.passed {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--sc-accent);
    color: #34d399;
}

.sc-quiz-result.failed {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #f87171;
}

/* WooCommerce Products Live Search */
.sc-woo-search-wrapper {
    width: 100%;
    position: relative;
}

.sc-woo-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 0 18px;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.sc-woo-search-box:focus-within {
    border-color: var(--sc-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background: rgba(255, 255, 255, 0.07);
}

.sc-woo-search-icon {
    font-size: 1.1rem;
    color: var(--sc-text-muted, #94a3b8);
    margin-right: 12px;
}

#scWooProductSearchInput {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
    padding: 14px 0;
}

#scWooProductSearchInput::placeholder {
    color: var(--sc-text-muted, #94a3b8);
}

.sc-woo-search-clear {
    background: transparent;
    border: none;
    color: var(--sc-text-muted, #94a3b8);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    transition: color 0.2s ease;
}

.sc-woo-search-clear:hover {
    color: #ffffff;
}

.sc-woo-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    backdrop-filter: blur(16px);
}

.sc-woo-product-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #ffffff;
    transition: background 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}

.sc-woo-product-item:last-child {
    border-bottom: none;
}

.sc-woo-product-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.sc-woo-product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 14px;
    background: rgba(255,255,255,0.05);
}

.sc-woo-product-info {
    flex: 1;
    min-width: 0;
}

.sc-woo-product-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 4px 0;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-woo-product-price {
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 600;
}

.sc-woo-product-arrow {
    color: var(--sc-text-muted, #94a3b8);
    font-size: 0.9rem;
    margin-left: 12px;
}

/* ─── Dedicated WhatsApp-Style Tickets Messenger Page ─── */
/* ─── Dedicated WhatsApp-Style Tickets Messenger Page ─── */
.sc-tickets-messenger-layout {
    display: flex;
    height: 85vh;
    min-height: 600px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(0,0,0,0.5);
}

.sc-tickets-sidebar {
    background: #111827;
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    width: 350px;
    min-width: 350px;
}

.sc-tickets-sidebar-header {
    height: 60px;
    padding: 0 16px;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sc-tickets-sidebar-header-left {
    display: flex;
    align-items: center;
}

.sc-tickets-sidebar-header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sc-icon-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-icon-btn:hover {
    color: #cbd5e1;
}

.sc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.sc-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.2rem;
}

.sc-tickets-search-container {
    padding: 8px 12px;
    background: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sc-tickets-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #1e293b;
    border-radius: 8px;
    padding: 6px 12px;
    color: #94a3b8;
}

.sc-tickets-search-box input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.9rem;
    margin-left: 12px;
}

.sc-filter-btn {
    font-size: 1rem;
    padding: 6px;
}

.sc-tickets-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sc-tickets-list::-webkit-scrollbar {
    width: 6px;
}
.sc-tickets-list::-webkit-scrollbar-track {
    background: transparent;
}
.sc-tickets-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sc-ticket-item {
    display: flex;
    padding: 12px 16px;
    text-decoration: none;
    color: #ffffff;
    transition: background 0.2s;
    align-items: center;
    gap: 12px;
    position: relative;
}

.sc-ticket-item:hover, .sc-ticket-item.active {
    background: #1e293b;
}

.sc-ticket-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 76px;
    height: 1px;
    background: rgba(255,255,255,0.05);
}

.sc-ticket-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sc-ticket-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sc-ticket-item-subject {
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f1f5f9;
}

.sc-ticket-date {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.sc-ticket-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #94a3b8;
}

.sc-ticket-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.sc-badge.status-open { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.sc-badge.status-replied { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.sc-badge.status-closed { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

.sc-ticket-unread-dot {
    background: #3b82f6;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
}

.sc-tickets-chat-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #0b141a;
    position: relative;
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M10 10h10v10H10z" fill="rgba(255,255,255,0.02)"/%3E%3C/svg%3E');
}

.sc-tickets-chat-header {
    height: 60px;
    padding: 0 16px;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sc-tickets-chat-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sc-tickets-chat-header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.sc-tickets-chat-title {
    display: flex;
    flex-direction: column;
}

.sc-tickets-chat-title h3 {
    margin: 0;
    font-size: 1rem;
    color: #f1f5f9;
    font-weight: 600;
}

.sc-chat-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-tickets-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sc-tickets-chat-body::-webkit-scrollbar {
    width: 6px;
}
.sc-tickets-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.sc-tickets-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sc-ticket-thread-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sc-chat-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-tickets-chat-footer {
    background: #1e293b;
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sc-chat-input-form {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.sc-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sc-chat-textarea {
    flex: 1;
    background: #334155;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: #f1f5f9;
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    outline: none;
}

.sc-chat-textarea::placeholder {
    color: #94a3b8;
}

.sc-chat-closed-notice {
    text-align: center;
    padding: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

.sc-tickets-empty-chat-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    background: #111827;
    position: relative;
    border-bottom: 6px solid #10b981;
}

.sc-splash-content {
    max-width: 400px;
}

.sc-splash-icon {
    font-size: 5rem;
    color: #94a3b8;
    margin-bottom: 30px;
}

.sc-splash-image {
    max-width: 100%;
    margin-bottom: 30px;
}

.sc-tickets-empty-chat-splash h2 {
    font-size: 1.8rem;
    color: #f1f5f9;
    font-weight: 300;
    margin-bottom: 15px;
}

.sc-tickets-empty-chat-splash p {
    color: #94a3b8;
    line-height: 1.6;
}

.sc-splash-footer {
    position: absolute;
    bottom: 30px;
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 900px) {
    .sc-tickets-messenger-layout {
        flex-direction: column;
    }
    .sc-tickets-messenger-layout.has-active-ticket .sc-tickets-sidebar {
        display: none;
    }
    .sc-tickets-sidebar {
        width: 100%;
    }
    .sc-tickets-messenger-layout:not(.has-active-ticket) .sc-tickets-chat-area {
        display: none;
    }
    .sc-tickets-back-btn {
        display: flex;
    }
}


/* =========================================================================
   Live product search dropdown — exactly five rows tall, then it scrolls
   ========================================================================= */

.sc-woo-search-dropdown {
    /* row = 48px thumb + 12px padding top/bottom + 1px divider */
    max-height: 365px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.sc-woo-search-dropdown::-webkit-scrollbar { width: 8px; }
.sc-woo-search-dropdown::-webkit-scrollbar-track { background: transparent; }
.sc-woo-search-dropdown::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
    border: 2px solid #1e293b;
}

.sc-woo-product-item {
    box-sizing: border-box;
    min-height: 73px;
    gap: 0;
}

.sc-woo-product-item:focus-visible {
    outline: 2px solid var(--sc-primary, #2393a2);
    outline-offset: -2px;
}

.sc-woo-product-info { display: block; }
.sc-woo-product-title { display: block; }
.sc-woo-product-price { display: block; }

.sc-ss-nothumb {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.14);
}

.sc-ss-oos {
    margin-left: 8px;
    font-style: normal;
    font-size: 0.74rem;
    font-weight: 600;
    color: #f87171;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.sc-ss-arrow {
    display: inline-flex;
    align-items: center;
    color: var(--sc-text-muted, #94a3b8);
    margin-left: 12px;
    flex: 0 0 auto;
}

.sc-woo-product-item:hover .sc-ss-arrow { color: #ffffff; }

.sc-ss-note {
    padding: 26px 20px;
    text-align: center;
    color: var(--sc-text-muted, #94a3b8);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =========================================================================
   Code blocks inside lesson / task / project content
   One look for every snippet, with the copy control inside the block.
   ========================================================================= */

.sc-code-wrap {
    position: relative;
    margin: 22px 0;
}

.sc-code-wrap pre.sc-code,
pre.sc-code {
    display: block;
    margin: 0;
    padding: 20px 22px 20px 22px;
    background: #0d1520;
    border: 1px solid rgba(35, 147, 162, 0.32);
    border-left: 4px solid var(--sc-primary, #2393a2);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: pre !important;
    word-wrap: normal;
    word-break: normal;
    tab-size: 4;
    -moz-tab-size: 4;
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Courier New", monospace;
    font-size: 13.5px;
    line-height: 1.65;
    color: #d7e3ea;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 6px 18px rgba(0, 0, 0, 0.28);
}

/* Room for the copy button so it never sits on top of the first line. */
.sc-code-wrap pre.sc-code {
    padding-top: 46px;
}

.sc-code-wrap pre.sc-code code,
pre.sc-code code {
    display: block;
    padding: 0;
    margin: 0;
    background: none !important;
    border: 0 !important;
    border-radius: 0;
    color: inherit !important;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre !important;
}

/* Copy control */
.sc-code-copy {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(35, 147, 162, 0.45);
    border-radius: 7px;
    background: rgba(35, 147, 162, 0.14);
    color: #9fd9e2;
    font-family: inherit;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sc-code-wrap:hover .sc-code-copy { opacity: 1; }

.sc-code-copy:hover {
    background: rgba(35, 147, 162, 0.28);
    color: #ffffff;
}

.sc-code-copy.copied {
    opacity: 1;
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.sc-code-copy svg { flex: 0 0 auto; }

/* Inline code stays inline — small, tinted, never full-width */
.sc-lp-lesson-body :not(pre) > code,
.sc-portal-wrapper :not(pre) > code {
    padding: 2px 7px;
    margin: 0 1px;
    background: rgba(35, 147, 162, 0.16);
    border: 1px solid rgba(35, 147, 162, 0.28);
    border-radius: 5px;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 0.9em;
    color: #7fd8e4;
    white-space: normal;
}

pre.sc-code::-webkit-scrollbar { height: 9px; }
pre.sc-code::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 0 0 12px 12px; }
pre.sc-code::-webkit-scrollbar-thumb { background: #33505f; border-radius: 5px; }
pre.sc-code::-webkit-scrollbar-thumb:hover { background: var(--sc-primary, #2393a2); }

.sc-lp-lesson-body blockquote,
.sc-portal-wrapper blockquote {
    margin: 20px 0;
    padding: 14px 20px;
    border-left: 4px solid rgba(148, 163, 184, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 8px 8px 0;
    color: var(--sc-text-muted, #94a3b8);
}

/* =========================================================================
   Student dashboard typography — 14px baseline, headings untouched
   The :not(.sc-wa-wrapper) guard keeps the support messenger, which has its
   own type scale, out of this sweep.
   ========================================================================= */

.sc-portal-wrapper:not(.sc-wa-wrapper) {
    font-size: 14px;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) p,
.sc-portal-wrapper:not(.sc-wa-wrapper) span,
.sc-portal-wrapper:not(.sc-wa-wrapper) li,
.sc-portal-wrapper:not(.sc-wa-wrapper) td,
.sc-portal-wrapper:not(.sc-wa-wrapper) th,
.sc-portal-wrapper:not(.sc-wa-wrapper) label,
.sc-portal-wrapper:not(.sc-wa-wrapper) small,
.sc-portal-wrapper:not(.sc-wa-wrapper) a,
.sc-portal-wrapper:not(.sc-wa-wrapper) div {
    font-size: 14px;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) h1,
.sc-portal-wrapper:not(.sc-wa-wrapper) h2,
.sc-portal-wrapper:not(.sc-wa-wrapper) h3,
.sc-portal-wrapper:not(.sc-wa-wrapper) h4,
.sc-portal-wrapper:not(.sc-wa-wrapper) h1 *,
.sc-portal-wrapper:not(.sc-wa-wrapper) h2 *,
.sc-portal-wrapper:not(.sc-wa-wrapper) h3 *,
.sc-portal-wrapper:not(.sc-wa-wrapper) h4 * {
    font-size: inherit;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="text"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="email"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="password"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="search"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="number"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="file"],
.sc-portal-wrapper:not(.sc-wa-wrapper) select,
.sc-portal-wrapper:not(.sc-wa-wrapper) textarea {
    font-size: 14px;
    padding: 12px 14px;
    line-height: 1.5;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="text"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="email"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="password"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="search"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="number"],
.sc-portal-wrapper:not(.sc-wa-wrapper) select {
    min-height: 48px;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) textarea {
    min-height: 110px;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) button,
.sc-portal-wrapper:not(.sc-wa-wrapper) .button,
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="submit"],
.sc-portal-wrapper:not(.sc-wa-wrapper) input[type="button"],
.sc-portal-wrapper:not(.sc-wa-wrapper) .sc-btn {
    font-size: 14px;
    padding: 12px 24px;
}

/* Code blocks keep their own monospace scale. */
.sc-portal-wrapper:not(.sc-wa-wrapper) pre.sc-code,
.sc-portal-wrapper:not(.sc-wa-wrapper) pre.sc-code code,
.sc-portal-wrapper:not(.sc-wa-wrapper) pre.sc-code span,
.sc-portal-wrapper:not(.sc-wa-wrapper) pre.sc-code div {
    font-size: 13.5px;
}

.sc-portal-wrapper:not(.sc-wa-wrapper) .sc-code-copy {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 0;
}
