/*
================================================================================
  File: webapp/static/webapp/css/custom.css
  Description: Unified and cleaned-up stylesheet for the MatchMyCareer application.
  Version: 3.0 (Consolidated)
================================================================================
*/

/*
================================================
  1. Base & Global Styles
================================================
*/
:root {
    --black: #0d0c0d;
    --dark-gray: #1e1e1e;
    --mid-gray: #3a3a3d;
    --primary-purple: #8f44fd;
    --primary-glow: rgba(143, 68, 253, 0.4);
    --primary-glow-intense: rgba(143, 68, 253, 0.7);
    --window-bar-bg: #2a2a2e;
    --window-bar-border: #4a4a4f;
    --text-muted: #8c8c8e;
    --text-bright: #e0e0e0;
    --success-green: #27c93f;
    --warning-yellow: #ffbd2e;
    --danger-red: #ff5f56;
}

html, body {
    background-color: #121212;
    color: #f5f5f5;
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

/*
================================================
  2. Navbar & Footer
================================================
*/
.navbar {
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, #1c1c1c, #121212);
}
.navbar::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-purple), #6a1b9a);
}

.navbar-nav .nav-link {
    border: 1px solid transparent;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    border-color: var(--primary-purple);
    background-color: rgba(143, 68, 253, 0.1);
}

footer {
    position: relative;
    background: linear-gradient(180deg, #121212, #1c1c1c);
    color: #ccc;
    text-align: center;
    padding: 1rem 0;
    flex-shrink: 0;
}
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #6a1b9a, var(--primary-purple));
}

.brand-logo {
    max-height: 40px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    transition: all 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px var(--primary-glow-intense));
}

.brand-favicon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.navbar-brand .brand-logo {
    margin-right: 12px;
    vertical-align: middle;
}

.footer-logo {
    max-height: 28px;
    opacity: 0.8;
    filter: grayscale(100%) brightness(150%);
}

/*
================================================
  3. Typography & General Components
================================================
*/
h1, h2, h3, h4, h5 {
    font-weight: 500;
    margin-bottom: 1rem;
}

.text-gradient {
  background: linear-gradient(90deg, var(--primary-purple), #6a1b9a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.brand-highlight {
  font-weight: 700;
  color: var(--primary-purple);
  text-shadow: 0 0 10px var(--primary-glow);
  letter-spacing: -1px;
}

.agentic-highlight {
  font-weight: 600;
  color: var(--primary-purple);
  border-bottom: 1px dotted var(--primary-purple);
  padding-bottom: 1px;
}

.purple-accent {
  border-top: 3px solid var(--primary-purple);
  box-shadow: 0 4px 15px rgba(143, 68, 253, 0.1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.country-flag {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: inline-block;
  vertical-align: middle;
}

.language-badge {
  background-color: rgba(143, 68, 253, 0.1);
  color: var(--primary-purple);
  border: 1px solid rgba(143, 68, 253, 0.3);
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

/*
================================================
  4. Landing Page Specific Styles
================================================
*/
.landing-page { padding: 2rem 0; }
.alpha-tester-box {
  background: linear-gradient(145deg, rgba(26, 26, 26, 0.8), rgba(20, 20, 20, 0.9));
  border-left: 4px solid var(--primary-purple);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
}
.alpha-tester-box .bi-stars { color: #ffc107; }
.landing-page .bi-check-circle-fill { color: var(--primary-purple); }

.landing-page .feature-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0.75rem;
  border-radius: 8px;
}
.landing-page .feature-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background-color: rgba(143, 68, 253, 0.05);
}
.landing-page .feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
}
@media (max-width: 992px) {
  .landing-page h1 { font-size: 2.5rem; }
  .landing-page h2 { font-size: 1.8rem; }
}
@media (max-width: 768px) {
  .landing-page h1 { font-size: 2rem; }
  .landing-page h2 { font-size: 1.5rem; }
}

/*
================================================
  5. Workflow Terminal Styles (Consolidated)
================================================
*/

/* --- Main Terminal Container --- */
#terminal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px; /* Enforced max-width */
    height: 75vh; /* Use viewport height for responsiveness */
    min-height: 400px;
    max-height: 800px;
    background: var(--dark-gray);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    border-radius: 0.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--window-bar-border);
    overflow: hidden;
    margin: 0 auto;
}

/* --- Window Bar --- */
.window-bar {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--window-bar-bg);
    border-bottom: 1px solid var(--window-bar-border);
    flex-shrink: 0;
    user-select: none;
}
.window-controls { display: flex; gap: 0.5rem; margin-right: 1rem; }
.window-controls .btn { width: 12px; height: 12px; border-radius: 50%; border: none; }
.btn.close { background-color: var(--danger-red); cursor: pointer; }
.btn.minimize { background-color: var(--warning-yellow); }
.btn.maximize { background-color: var(--success-green); }
.window-title { color: var(--text-bright); font-weight: 500; text-align: center; flex-grow: 1; }

/* --- CRT Effect & Content Layout --- */
#crt-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle, #2a2a2e 0%, var(--black) 100%);
    flex-grow: 1;
    display: flex;
}
#crt-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0, rgba(0,0,0,0.25) 1px, transparent 1px, transparent 3px);
    animation: scanline 20s linear infinite;
    z-index: 2;
}
@keyframes scanline { 0% { background-position: 0 0; } 100% { background-position: 0 100vh; } }

.terminal-content { width: 100%; height: 100%; position: relative; display: flex; flex-direction: column; }
#boot-screen { padding: 1rem; box-sizing: border-box; overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#workflow-view { display: none; flex-direction: row; width: 100%; height: 100%; flex-grow: 1; }
.terminal-pane { height: 100%; box-sizing: border-box; display: flex; flex-direction: column;}

/* --- Animation & Message Panes --- */
#animation-pane {
    flex: 1 1 50%;
    border-right: 1px solid var(--window-bar-border);
    padding: 0;
    overflow: hidden;
    position: relative;
}
#animation-canvas { display: block; width: 100%; height: 100%; background-color: transparent; }

#message-pane {
    flex: 1 1 50%;
    padding: 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mid-gray) transparent;
}
#message-pane::-webkit-scrollbar { width: 8px; }
#message-pane::-webkit-scrollbar-track { background: transparent; }
#message-pane::-webkit-scrollbar-thumb { background-color: var(--mid-gray); border-radius: 4px; border: 1px solid var(--window-bar-border); }
#message-pane::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); }

/* --- Text & Line Styling --- */
.line { white-space: pre-wrap; line-height: 1.4; color: var(--primary-purple); text-shadow: 0 0 5px var(--primary-glow); margin-bottom: 0.25em; }
.line.error { color: var(--danger-red); text-shadow: 0 0 5px rgba(255, 95, 86, 0.5); }
.line.success { color: var(--success-green); text-shadow: 0 0 5px rgba(39, 201, 63, 0.5); }
.line.warning { color: var(--warning-yellow); text-shadow: 0 0 5px rgba(255, 189, 46, 0.5); }

#bios-logo { white-space: pre; text-align: center; font-size: 1rem; line-height: 1.1; margin-bottom: 1rem; color: var(--primary-purple); text-shadow: 0 0 8px var(--primary-glow-intense); }
#bios-status, #reconnect-status { font-size: 1rem; min-height: 1.2em; }

/* --- Footer & Progress Bar --- */
#terminal-footer {
    flex-shrink: 0;
    padding: 0.75rem;
    background: var(--window-bar-bg);
    border-top: 1px solid var(--window-bar-border);
    opacity: 0;
    transition: opacity 0.5s ease-in;
    display: flex;
    gap: 1rem;
    align-items: center;
}
#terminal-footer.visible {
    opacity: 1;
}
#workflow-progress-bar {
    flex-grow: 1;
    width: 100%;
    height: 1.75rem;
    background-color: rgba(0,0,0,0.4);
    border: 1px solid var(--window-bar-border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
#workflow-progress-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple) 0%, #c49cff 100%);
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
#workflow-progress-label {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-bright);
    font-size: 0.875rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}


/*
================================================
  6. Animations & Transitions
================================================
*/
.fade-in {
  animation: fadeInAnimation 0.5s ease-in-out forwards;
}
@keyframes fadeInAnimation {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-out {
  animation: fadeOutAnimation 0.5s ease-in-out forwards;
}
@keyframes fadeOutAnimation {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
/*
================================================
  7. Responsive Terminal Styles
================================================
*/
#mobile-view-toggle { display: none; } /* Hidden by default */

@media (max-width: 768px) {
    #terminal-container {
        height: 90vh; /* Adjust height for mobile */
    }
    #workflow-view {
        flex-direction: column;
        position: relative;
    }
    .terminal-pane {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        border-right: none !important;
        transition: opacity 0.3s ease, visibility 0.3s;
    }
    #animation-pane {
        opacity: 0; visibility: hidden; pointer-events: none;
    }
    #animation-pane.active {
        opacity: 1; visibility: visible; pointer-events: auto;
    }
    #message-pane {
        opacity: 1; visibility: visible; pointer-events: auto;
    }
    #message-pane.hidden {
        opacity: 0; visibility: hidden; pointer-events: none;
    }
    #mobile-view-toggle {
        display: flex;
        gap: 0.5rem;
    }
}

.toggle-btn {
    background-color: var(--mid-gray);
    border: 1px solid var(--window-bar-border);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.8rem;
}
.toggle-btn:hover { background-color: #4f4f53; }
.toggle-btn.active { background-color: var(--primary-purple); color: var(--text-bright); text-shadow: 0 0 5px var(--primary-glow); }

/*
================================================
  8. Document Dashboard Specific Styles
================================================
*/
.document-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: #1e1e1e;
  border-radius: 0.375rem;
}
.document-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.document-card .card-title {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}
.document-card .progress {
  height: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 0.375rem;
  overflow: hidden;
}
.document-card .progress-bar {
  background: linear-gradient(90deg, #8f44fd, #6a1b9a);
  background-size: 200% 100%;
  animation: gradientShift 2s ease infinite;
}
.document-list {
  border-radius: 0.375rem;
  background-color: rgba(0, 0, 0, 0.1);
}

/* Apply max-height only on smaller screens */
@media (max-width: 1200px) {
  .document-list {
    max-height: 300px;
    overflow-y: auto;
  }
}
.document-list .list-group-item {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
.document-list .list-group-item:hover {
  background-color: rgba(143, 68, 253, 0.05);
  transform: translateX(3px);
}
.language-counts .badge {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: rgba(143, 68, 253, 0.1);
  color: #8f44fd;
  border: 1px solid rgba(143, 68, 253, 0.3);
}

#dropArea {
  border: 2px dashed rgba(143, 68, 253, 0.3);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background-color: rgba(143, 68, 253, 0.05);
}
#dropArea:hover {
  border-color: #8f44fd;
  background-color: rgba(143, 68, 253, 0.1);
}
#dropArea i {
  font-size: 2rem;
  color: #8f44fd;
  margin-bottom: 1rem;
}
