/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: #000000;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* Matrix Canvas */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Container */
.container {
    display: flex;
    height: 100vh;
    background: transparent;
}

/* Left Panel - 3D Card */
.left-panel {
    width: 400px;
    background: rgba(0, 0, 0, 0.6);
    border-right: 2px solid #00ff00;
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.interactive-card {
    width: 320px;
    height: 420px;
    perspective: 1000px;
    cursor: grab;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}

.interactive-card:active {
    cursor: grabbing;
}

.card-face {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.card-face::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 0, 0.05);
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #00ff00;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red {
    background: #ff5f56;
}

.control.yellow {
    background: #ffbd2e;
}

.control.green {
    background: #27c93f;
}

.card-title {
    font-size: 14px;
    color: #00ff00;
    font-weight: 500;
}

.profile-section {
    text-align: center;
    margin-bottom: 30px;
}

.avatar {
    margin-bottom: 20px;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: #00ff00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.profile-info p {
    color: #a0a0a0;
    font-size: 14px;
    margin-bottom: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #00ff00;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.quick-stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #a0a0a0;
}

.card-hint {
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* Right Panel - Terminal */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.85);
}

.terminal-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.terminal-header-nav {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid #00ff00;
    padding: 12px 20px;
}

.nav-commands {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.nav-cmd {
    color: #4facfe;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.nav-cmd:hover {
    color: #00f2fe;
    background: rgba(79, 172, 254, 0.1);
}

.nav-separator {
    color: #555;
    user-select: none;
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.welcome-section {
    margin-bottom: 20px;
}

.command-line {
    font-size: 14px;
    margin-bottom: 15px;
}

.prompt {
    color: #00ff00;
    font-weight: 500;
}

.command {
    color: #ffffff;
    margin-left: 8px;
}

.typing-animation {
    animation: typing 3s steps(6) infinite;
}

@keyframes typing {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.7;
    }
}

.welcome-text {
    color: #e0e0e0;
    line-height: 1.6;
}

.welcome-text p {
    margin-bottom: 8px;
}

.highlight {
    color: #4facfe;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(79, 172, 254, 0.5);
}

.terminal-output {
    flex: 1;
    margin-bottom: 20px;
}

.output-block {
    margin: 15px 0;
    font-size: 14px;
}

.output-command {
    color: #00ff00;
    margin-bottom: 8px;
}

.output-content {
    color: #e0e0e0;
    line-height: 1.6;
    padding-left: 20px;
}

.output-content h3 {
    color: #4facfe;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: none;
}

.output-content ul {
    list-style: none;
    margin: 10px 0;
}

.output-content li {
    margin-bottom: 6px;
    position: relative;
    padding-left: 20px;
}

.output-content li::before {
    content: '▶';
    color: #00ff00;
    position: absolute;
    left: 0;
    top: 0;
}

.error {
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.success {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.input-line {
    display: flex;
    align-items: center;
    margin-top: auto;
    font-size: 14px;
    cursor: text;
    padding: 5px 0;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    flex: 1;
    margin-left: 8px;
    caret-color: #00ff00;
    min-width: 200px;
    position: relative;
    z-index: 1;
}

.terminal-input::placeholder {
    color: #666;
    opacity: 0.7;
}

.cursor {
    color: #00ff00;
    animation: blink 1s infinite;
    margin-left: 4px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.terminal-footer {
    background: rgba(0, 0, 0, 0.9);
    border-top: 2px solid #00ff00;
    padding: 8px 20px;
}

.status-bar {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #00ff00;
}

.status-item::before {
    content: '●';
    margin-right: 6px;
}

/* AI Typing Animation Styles */
.ai-typing {
    position: relative;
    overflow: hidden;
}

.ai-typing-text {
    opacity: 0;
    animation: aiTypeIn 0.1s ease-in-out forwards;
}

@keyframes aiTypeIn {
    from {
        opacity: 0;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-typing-cursor {
    display: inline-block;
    background-color: #10b981;
    width: 2px;
    height: 14px;
    animation: aiCursorBlink 0.8s infinite;
    margin-left: 1px;
}

@keyframes aiCursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

/* Hide the default cursor when AI is typing */
.terminal-input.ai-active {
    caret-color: transparent;
}

/* AI thinking indicator */
.ai-thinking {
    color: #71717a;
    font-style: italic;
    animation: thinking 1.5s ease-in-out infinite;
}

@keyframes thinking {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #000000;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        height: 300px;
        flex-direction: row;
        justify-content: center;
        padding: 20px;
    }

    .interactive-card {
        width: 250px;
        height: 200px;
    }

    .card-hint {
        display: none;
    }
}

@media (max-width: 768px) {
    .left-panel {
        height: 250px;
    }

    .interactive-card {
        width: 200px;
        height: 160px;
    }

    .card-face {
        padding: 15px;
    }

    .profile-info h2 {
        font-size: 20px;
    }

    .avatar-placeholder {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }

    .nav-commands {
        font-size: 11px;
    }

    .terminal-body {
        padding: 15px;
    }
}

/* AI Enhancement Styles */
.ai-thinking-container {
    margin: 10px 0;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    animation: aiGlow 2s ease-in-out infinite alternate;
}

@keyframes aiGlow {
    from {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
    }

    to {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    }
}

.ai-thinking-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #10b981;
    font-size: 14px;
}

.ai-brain {
    font-size: 18px;
    animation: brainPulse 1.5s ease-in-out infinite;
}

@keyframes brainPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.ai-thinking-text {
    font-style: italic;
}

.ai-dots {
    display: flex;
    gap: 2px;
}

.ai-dots span {
    animation: dotBounce 1.4s ease-in-out infinite;
    animation-fill-mode: both;
}

.ai-dots span:nth-child(1) {
    animation-delay: 0.0s;
}

.ai-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        opacity: 0.4;
        transform: translateY(0px);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* AI Status Indicator */
#ai-status {
    transition: all 0.3s ease;
}

#ai-status.ai-working {
    color: #f59e0b;
    animation: aiWorking 1s ease-in-out infinite;
}

@keyframes aiWorking {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

#ai-status.ai-error {
    color: #ef4444;
}

#ai-status.ai-success {
    color: #10b981;
}

/* Enhanced Input with AI indicator */
.terminal-input.ai-processing {
    border-bottom: 2px solid #10b981;
    animation: aiInputGlow 1s ease-in-out infinite;
}

@keyframes aiInputGlow {

    0%,
    100% {
        border-bottom-color: #10b981;
    }

    50% {
        border-bottom-color: #22c55e;
    }
}

/* AI Correction Display */
.ai-correction {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding: 10px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
}

.ai-correction-header {
    color: #3b82f6;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.ai-correction-text {
    color: #e4e4e7;
    font-style: italic;
}

.correction-suggestion {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

/* Enhanced welcome section for AI */
.welcome-text em {
    color: #3b82f6;
    font-style: italic;
}

/* AI Response indicator */
.ai-response {
    position: relative;
    padding-left: 25px;
}

.ai-response::before {
    content: '🤖';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 16px;
}

/* Loading animation for AI responses */
.ai-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    border-top-color: #10b981;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}