/* =========================================
   TutorSpace - Ultra Modern Portal
   ========================================= */

/* --- 1. Variables & Base Theme --- */
:root {
    --ltc-primary: #4e73df;
    --ltc-primary-dark: #224abe;
    --ltc-success: #1cc88a;
    --ltc-info: #36b9cc;
    --ltc-warning: #f6c23e;
    --ltc-danger: #e74a3b;
    --ltc-dark: #2e303e;
    --ltc-light: #f8f9fc;
    --ltc-card-bg: #ffffff;
    --ltc-text-main: #4a4c58;
    --ltc-text-muted: #858796;
    --ltc-border-radius: 16px;
    --ltc-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --ltc-shadow-hover: 0 15px 35px rgba(50, 50, 93, 0.1);
}

/* Blank Page Reset (Keep this from previous step) */
header, footer, #masthead, #colophon, .site-header, .site-footer, .sidebar, #sidebar, #secondary, .widget-area, .entry-header, .entry-footer, .ast-header-breadcrumb, .breadcrumb { display: none !important; }
html, body { margin: 0 !important; padding: 0 !important; height: 100%; width: 100%; background-color: var(--ltc-light) !important; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
#page, .site, .site-content, .entry-content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; background: transparent !important; }

/* Wrapper */
.ltc-portal-wrapper {
    position: absolute; top: 0; left: 0; right: 0; min-height: 100vh;
    background: linear-gradient(180deg, #f8f9fc 0%, #eef1f5 100%);
    padding: 40px 20px;
    box-sizing: border-box;
    z-index: 999;
}
.ltc-portal-container-inner { max-width: 1000px; margin: 0 auto; }

/* --- 2. Animations --- */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.animate-fade-down { animation: fadeDown 0.6s ease-out forwards; }
.animate-fade-up { opacity: 0; animation: fadeUp 0.6s ease-out forwards; }

/* --- 3. Modern Header --- */
.ltc-modern-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 40px; flex-wrap: wrap; gap: 15px;
}
.ltc-modern-header h1 { font-size: 2rem; font-weight: 800; color: var(--ltc-dark); margin: 0; letter-spacing: -0.5px; }
.ltc-modern-header .highlight-text { color: var(--ltc-primary); position: relative; }
.ltc-modern-header p { color: var(--ltc-text-muted); font-size: 1.1rem; margin: 5px 0 0 0; }
.ltc-modern-header .header-date {
    background: #fff; padding: 10px 20px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); color: var(--ltc-primary); font-weight: 700;
}

/* --- 4. Navigation Pills --- */
.ltc-modern-nav {
    background: #fff; padding: 5px; border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03); display: inline-flex;
}
.ltc-modern-nav .nav-link {
    border-radius: 50px; padding: 10px 24px; color: var(--ltc-text-muted);
    font-weight: 600; transition: all 0.3s ease; border: none; background: transparent;
}
.ltc-modern-nav .nav-link:hover { color: var(--ltc-primary); background: rgba(78, 115, 223, 0.05); }
.ltc-modern-nav .nav-link.active {
    background: var(--ltc-primary); color: #fff; box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}
.ltc-modern-nav i { margin-right: 8px; }

/* --- 5. Modern Cards --- */
.ltc-modern-card {
    background: #fff; border-radius: var(--ltc-border-radius);
    box-shadow: var(--ltc-shadow); border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; height: 100%;
}
.ltc-modern-card:hover { transform: translateY(-5px); box-shadow: var(--ltc-shadow-hover); }

/* Student Card Specifics */
.card-header-gradient {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    padding: 25px; color: white; display: flex; align-items: center; gap: 15px;
}
.student-avatar {
    width: 50px; height: 50px; background: rgba(255,255,255,0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 800; border: 2px solid rgba(255,255,255,0.3);
}
.card-header-gradient h3 { font-size: 1.2rem; margin: 0; font-weight: 700; color: #fff; }
.badge-grade {
    background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.card-body-modern { padding: 25px; }

/* Timeline Styles */
.section-label { font-size: 0.75rem; text-transform: uppercase; color: var(--ltc-text-muted); font-weight: 700; margin-bottom: 20px; letter-spacing: 1px; }
.ltc-timeline { position: relative; border-left: 2px solid #e3e6f0; margin-left: 10px; padding-left: 20px; }
.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-dot {
    width: 12px; height: 12px; background: #fff; border: 3px solid var(--ltc-primary);
    border-radius: 50%; position: absolute; left: -27px; top: 5px;
}
.timeline-content { background: #f8f9fc; padding: 15px; border-radius: 12px; border: 1px solid #edf0f5; }
.timeline-meta { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.8rem; }
.timeline-meta .date { font-weight: 700; color: var(--ltc-dark); }
.timeline-meta .tutor { color: var(--ltc-primary); }
.timeline-content p { margin: 0; font-size: 0.9rem; color: var(--ltc-text-main); line-height: 1.5; }

/* --- 6. Forms & Inputs --- */
.modern-label { font-size: 0.85rem; font-weight: 700; color: var(--ltc-text-main); margin-bottom: 8px; display: block; }
.modern-input {
    border: 2px solid #eaecf4; border-radius: 10px; padding: 12px 15px;
    font-size: 0.95rem; color: #5a5c69; transition: all 0.2s; background: #fff; width: 100%;
}
.modern-input:focus { border-color: var(--ltc-primary); box-shadow: 0 0 0 4px rgba(78, 115, 223, 0.1); outline: none; }

/* --- 7. Buttons --- */
.btn-modern {
    border: none; padding: 12px 25px; border-radius: 50px; font-weight: 700;
    cursor: pointer; transition: all 0.3s; font-size: 0.95rem; display: inline-flex; align-items: center; justify-content: center;
}
.btn-modern:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.15); }
.btn-primary-gradient { background: linear-gradient(135deg, #4e73df 0%, #224abe 100%); color: white; }
.btn-success-gradient { background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%); color: white; }
.btn-danger-gradient { background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%); color: white; }
.btn-outline-primary { border: 2px solid var(--ltc-primary); color: var(--ltc-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--ltc-primary); color: white; }

/* --- 8. Action Cards (Attendance) --- */
.action-card { padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; height: 100%; }
.action-card .card-icon {
    width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin-bottom: 20px;
}
.danger-theme .card-icon { background: rgba(231, 74, 59, 0.1); color: var(--ltc-danger); }
.success-theme .card-icon { background: rgba(28, 200, 138, 0.1); color: var(--ltc-success); }
.action-card h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; color: var(--ltc-dark); }
.action-card p { color: var(--ltc-text-muted); margin-bottom: 20px; }
.card-actions { width: 100%; text-align: left; }

/* Upload Zone */
.upload-zone { border: 2px dashed #d1d3e2; background: #fff; }
.upload-icon-wrapper { font-size: 3rem; color: #d1d3e2; margin-bottom: 15px; }

/* Responsive */
@media (max-width: 768px) {
    .ltc-modern-nav { width: 100%; overflow-x: auto; white-space: nowrap; display: block; }
    .ltc-modern-nav .nav-link { padding: 10px 15px; font-size: 0.9rem; }
    .timeline-item { margin-left: 10px; }
}

/* ==========================================================================
   CONTAINED IMAGE PREVIEWS — 20.1.114
   Preview images retain their intrinsic aspect ratio and are only scaled down
   to fit the available modal or preview stage. They are never stretched,
   cropped, or forced to fill both dimensions.
   ========================================================================== */
.ltc-image-preview-stage {
    min-width: 0;
    min-height: 0;
    overflow: hidden !important;
}
.ltc-contained-preview-image,
img[data-ltc-image-preview="1"] {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    flex: 0 1 auto;
}
.modal .ltc-contained-preview-image,
.modal img[data-ltc-image-preview="1"] {
    max-width: calc(100vw - 3rem) !important;
    max-height: calc(100vh - 10rem) !important;
}
#training-preview-modal .modal-body,
#training-preview-modal #tp-image-container {
    min-height: 0;
    height: calc(85vh - 72px);
}
#training-preview-modal #tp-image {
    max-width: calc(100% - 2rem) !important;
    max-height: calc(100% - 2rem) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    border-radius: 8px;
}
#vault-preview-modal #vault-preview-img {
    max-width: 95% !important;
    max-height: 95% !important;
}
#ws-preview-image {
    max-width: 100% !important;
    max-height: min(70vh, 100%) !important;
}
