/* Premium SysAdmin Terminal Aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500&family=JetBrains+Mono:wght@300;400;700&display=swap');

:root {
    --bg-main: #05070a;
    --bg-card: rgba(22, 27, 34, 0.7);
    --border-color: #30363d;
    --accent-blue: #00d4ff;
    --accent-blue-glow: rgba(0, 212, 255, 0.3);
    --text-main: #e6edf3;
    --text-dim: #8b949e;
    --success-green: #238636;
    --error-red: #f85149;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 100%, 100% 4px, 3px 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    background-color: transparent;
    background-image: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
    padding: 15px;
    overflow-x: hidden;
}

/* CRT Scanline Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 1000;
}

.container {
    width: 98%;
    max-width: 2800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px var(--accent-blue-glow);
    flex-wrap: wrap;
    gap: 10px;
}

.header-title {
    color: var(--accent-blue);
    font-size: 1.2em;
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent-blue-glow);
    white-space: nowrap;
}

.prompt { color: var(--success-green); }
.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent-blue);
}

@keyframes blink { 50% { opacity: 0; } }

.header-domain {
    color: var(--text-dim);
    font-size: 0.85em;
    letter-spacing: 2px;
}

/* Status Row Layout */
.status-row {
    display: flex;
    align-items: stretch;
    gap: 15px;
    margin-bottom: 20px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.05);
}

.lang-btn.active {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.lang-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Status Bar */
.status-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #1a1f26;
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    width: 85%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #58a6ff);
    box-shadow: 0 0 15px var(--accent-blue);
    position: relative;
    animation: pulse-width 4s ease-in-out infinite;
}

@keyframes pulse-width {
    0%, 100% { width: 85%; }
    50% { width: 88%; }
}

.status-text {
    font-size: 0.8em;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 15px;
    color: var(--text-dim);
}

/* Grid */
.dashboard-grid {
    column-count: 4;
    column-gap: 15px;
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition);
    overflow: hidden;
    display: block;
    width: 100%;
    margin-bottom: 15px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue-glow);
    transform: translateY(-2px);
}

.card-disabled {
    opacity: 0.4;
    filter: grayscale(1);
    cursor: not-allowed;
    border-style: dashed;
    pointer-events: none;
}

.pinned {
    order: -1;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue-glow);
}

.pinned .card-header h2::after {
    content: " 📌";
    font-size: 0.8em;
}

#system-info {
    /* Height will now fit content automatically */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(48, 54, 61, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    color: var(--accent-blue);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-icon {
    color: var(--text-dim);
    opacity: 0.4;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
}

/* Data Rows - KEY FIX for overlapping */
.data-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.3);
}

.data-row:last-child { border-bottom: none; }

.data-label {
    color: var(--text-dim);
    font-size: 0.8em;
    min-width: 120px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-value {
    font-weight: 500;
    font-size: 0.85em;
    flex: 1;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}

/* Vertical layout for specific cards */
#system-info .data-row,
#tech-stack .data-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

#system-info .data-label,
#tech-stack .data-label {
    min-width: auto;
    margin-bottom: 4px;
}

#system-info .data-value,
#tech-stack .data-value {
    text-align: left;
    width: 100%;
}

/* Dotted List Styling */
.dotted-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    list-style: none;
    padding: 5px 0;
    margin: 0;
    width: 100%;
}

.dotted-list li {
    font-size: 0.9em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 15px;
}

.dotted-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
    text-shadow: 0 0 5px var(--accent-blue-glow);
}

/* Logs Viewport - Matrix Theme */
#logs-card .log-viewport {
    height: 375px;
    overflow: hidden; /* Programmatic scroll only */
    background: #000;
    border: 1px solid #003b00;
    box-shadow: inset 0 0 10px #003b00;
    color: #00ff41;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    display: flex;
    flex-direction: column;
}

/* Ensure no scrollbar ever appears in logs, even if max-height is reached */
#logs-card .log-viewport::-webkit-scrollbar {
    display: none;
    width: 0;
}

/* Custom scrollbar for terminal look */
#logs-card .log-viewport::-webkit-scrollbar {
    width: 6px;
}

#logs-card .log-viewport::-webkit-scrollbar-track {
    background: #000;
}

#logs-card .log-viewport::-webkit-scrollbar-thumb {
    background: #003b00;
    border-radius: 3px;
}

#logs-card .log-viewport::-webkit-scrollbar-thumb:hover {
    background: #00ff41;
}

.log-entry {
    margin-bottom: 4px;
    line-height: 1.4;
    font-size: 0.85em;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.experience-item {
    margin-bottom: 15px;
}

.experience-item:last-child {
    margin-bottom: 0;
}

.interactive-box {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.interactive-box:hover {
    background-color: rgba(0, 212, 255, 0.05);
    border-color: rgba(48, 54, 61, 0.5);
}

.box-title {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 700;
    opacity: 0.8;
}

.sub-list {
    list-style: none;
    padding-left: 25px;
    margin-top: 4px;
    margin-bottom: 10px;
}

.sub-list li {
    font-size: 0.85em;
    color: var(--text-dim);
    position: relative;
    padding-left: 12px;
    line-height: 1.4;
}

.sub-list li::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    opacity: 0.6;
}

.job-title {
    font-weight: 700;
}

.company {
    text-decoration: underline;
}

.company a {
    color: inherit;
    text-decoration: inherit;
    transition: none;
}

.company a:hover {
    text-shadow: none;
}

.date-range {
    font-style: italic;
}

/* Terminal Highlight Classes */
.bg-green-black { background: #00ff41; color: #000; padding: 0 4px; border-radius: 2px; font-weight: bold; }
.bg-red-white { background: #ff0000; color: #fff; padding: 0 4px; border-radius: 2px; font-weight: bold; }
.bg-yellow-black { background: #faff00; color: #000; padding: 0 4px; border-radius: 2px; font-weight: bold; }
.bg-blue-white { background: #00d4ff; color: #fff; padding: 0 4px; border-radius: 2px; font-weight: bold; }

.text-matrix-green { color: #00ff41; text-shadow: 0 0 5px rgba(0, 255, 65, 0.5); }
.text-matrix-yellow { color: #faff00; text-shadow: 0 0 5px rgba(250, 255, 0, 0.5); }

/* Custom Log Types Styling */
.log-info { color: #00ff41; }
.log-warn { color: #faff00; }
.log-fail { color: #ff3131; }
.log-auth { color: #00d4ff; }
.log-crit { color: #ff0000; font-weight: bold; animation: blink 0.5s step-end infinite; }
.log-debug { color: #8b949e; opacity: 0.6; }

.terminal-footer {
    margin-top: 40px;
    padding: 20px 0;
    background: transparent;
    border-top: 1px solid #30363d;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text-dim);
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.text-matrix-green { color: #00ff41; }

.cert-name {
    font-weight: 700;
    margin-right: 5px;
    color: var(--accent-blue);
}

.text-purple { color: #d3869b; }
.text-green { color: var(--success-green); }
.text-blue { color: var(--accent-blue); }
.text-gray { color: var(--text-dim); }
.text-dim { color: var(--text-dim); }
.text-red { color: var(--error-red); }

.cert-group {
    margin-bottom: 15px;
}

.cert-group:last-child {
    margin-bottom: 0;
}

.log-viewport {
    overflow-y: auto;
    max-height: 600px;
}

/* Custom cyberpunk scrollbar for the page */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #05070a;
    border-left: 1px solid #1a1f26;
}

::-webkit-scrollbar-thumb {
    background: #111;
    border: 2px solid #00d4ff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

html {
    scrollbar-width: thin;
    scrollbar-color: #00d4ff #05070a;
}
a { color: var(--accent-blue); text-decoration: none; transition: var(--transition); }
.action-btn {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 10px 20px;
    font-family: var(--font-mono);
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.action-btn:hover {
    background: var(--accent-blue);
    color: #000;
    box-shadow: 0 0 15px var(--accent-blue-glow);
}

/* Modal Styling */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-container {
    width: 50%;
    max-width: 800px;
    height: fit-content;
    background: var(--bg-card);
    border: 1px solid var(--accent-blue);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    position: relative;
    animation: modal-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-slide-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    cursor: pointer;
    font-size: 1.5em;
    color: var(--text-dim);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--accent-blue);
}

.modal-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    padding: 10px;
    width: 100%;
    transition: var(--transition);
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.05);
}

@media (max-width: 1000px) {
    .modal-container { width: 80%; }
}

@media (max-width: 768px) {
    .modal-container { width: 95%; }
}

.text-small { font-size: 0.8em; }
.text-smaller { font-size: 0.9em; }

.text-center { text-align: center; }
.p-20 { padding: 20px; }
.mb-15 { margin-bottom: 15px; }
.mb-10 { margin-bottom: 10px; }
.mt-20 { margin-top: 20px; }
.w-100 { width: 100%; }
.resize-v { resize: vertical; }

/* Modal specific fixes */
.modal-container .card-content {
    display: flex;
    flex-direction: column;
}

.modal-container .data-row.vertical {
    flex-direction: column;
    align-items: flex-start;
}

.custom-alert-box {
    width: 350px;
    text-align: center;
}

/* Avatar Glitch Effect */
.avatar-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    margin: 0 auto 15px;
    display: block;
    object-fit: cover;
}

.avatar-glitch {
    animation: avatar-flicker 1.5s infinite alternate;
}

@keyframes avatar-flicker {
    0%, 94%, 98% {
        opacity: 1;
        filter: brightness(1);
    }
    95%, 97%, 99% {
        opacity: 0.7;
        filter: brightness(0.5) contrast(1.5) hue-rotate(90deg);
    }
    96% {
        opacity: 0.9;
        filter: brightness(1.2);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-blue);
    font-size: 6em;
    animation: blink-three-times 1.5s ease-in-out 3 forwards;
    z-index: 999;
    pointer-events: none;
}

@keyframes blink-three-times {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Responsive */
@media (max-width: 1300px) {
    .dashboard-grid { column-count: 3; }
}

@media (max-width: 1000px) {
    .dashboard-grid { column-count: 2; }
}

@media (max-width: 768px) {
    body { padding: 15px; font-size: 14px; }
    .dashboard-grid { column-count: 1; }
    .top-bar { flex-direction: column; gap: 10px; text-align: center; }
    .header-title { font-size: 0.85em; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
    .data-label { min-width: 120px; }
    .data-value { text-align: left; }
}

@media (max-width: 480px) {
    .data-row { flex-direction: column; gap: 2px; }
    .data-label { min-width: auto; }
    .data-value { text-align: left; }
}