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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

/* Terminal Container */
.terminal-container {
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 
        0 20px 40px rgba(0, 255, 255, 0.1),
        0 0 50px rgba(0, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
    animation: terminalGlow 2s ease-in-out infinite alternate;
}

@keyframes terminalGlow {
    0% { box-shadow: 0 20px 40px rgba(0, 255, 255, 0.1), 0 0 50px rgba(0, 255, 255, 0.05); }
    100% { box-shadow: 0 20px 40px rgba(0, 255, 255, 0.2), 0 0 50px rgba(0, 255, 255, 0.1); }
}

/* Terminal Header */
.terminal-header {
    background: linear-gradient(90deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #444;
    position: relative;
}

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

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control.close {
    background: #ff5f57;
}

.control.minimize {
    background: #ffbd2e;
}

.control.maximize {
    background: #28ca42;
}

.control:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px currentColor;
}

.terminal-title {
    color: #00ff88;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.back-btn {
    color: #00aaff;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #00aaff;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #00aaff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

/* Terminal Body */
.terminal-body {
    height: calc(100% - 60px);
    padding: 20px;
    overflow-y: auto;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 136, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 170, 255, 0.03) 0%, transparent 50%);
}

.terminal-content {
    color: #00ff88;
    line-height: 1.6;
    font-size: 14px;
}

/* Welcome Message */
.welcome-message {
    margin-bottom: 30px;
    text-align: center;
}

.ascii-art {
    color: #00aaff;
    font-size: 12px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00aaff;
    animation: glitch 3s ease-in-out infinite;
}

@keyframes glitch {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px) skew(-1deg); }
    20% { transform: translateX(2px) skew(1deg); }
    30% { transform: translateX(-1px) skew(-0.5deg); }
    40% { transform: translateX(1px) skew(0.5deg); }
    50% { transform: translateX(0); }
}

.welcome-text {
    color: #00ff88;
    font-size: 18px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #00ff88;
}

.help-text {
    color: #888;
    font-size: 14px;
}

.command-highlight {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Command History */
.terminal-line {
    margin-bottom: 10px;
    word-wrap: break-word;
}

.command-line {
    color: #00aaff;
    margin-bottom: 5px;
}

.output-line {
    color: #00ff88;
    margin-left: 20px;
    white-space: pre-wrap;
}

.error-line {
    color: #ff6b6b;
    margin-left: 20px;
}

.warning-line {
    color: #ffaa00;
    margin-left: 20px;
}

/* Input Line */
.input-line {
    display: flex;
    align-items: center;
    margin-top: 20px;
    position: relative;
}

.prompt {
    color: #00aaff;
    margin-right: 8px;
    text-shadow: 0 0 5px #00aaff;
}

.command-input {
    background: transparent;
    border: none;
    color: #00ff88;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    flex: 1;
    caret-color: transparent;
}

.cursor {
    color: #00ff88;
    animation: blink 1s infinite;
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Command Suggestions */
.suggestions {
    position: absolute;
    bottom: 100px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    color: #888;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: #00ff88;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 136, 0.1);
    border-left: 3px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* Special Content Styling */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.skill-item {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.2);
}

.project-card {
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.project-card:hover {
    background: rgba(0, 170, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.2);
}

.project-title {
    color: #00aaff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.project-tech {
    color: #ffaa00;
    font-size: 12px;
    margin-top: 10px;
}

/* Matrix Effect Background */
@keyframes matrix {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.03;
}

.matrix-column {
    position: absolute;
    color: #00ff88;
    font-family: monospace;
    font-size: 14px;
    animation: matrix 10s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .terminal-header {
        padding: 10px 15px;
    }
    
    .terminal-title {
        font-size: 12px;
        position: static;
        transform: none;
        margin: 0 10px;
    }
    
    .back-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .terminal-body {
        padding: 15px;
    }
    
    .ascii-art {
        font-size: 10px;
    }
    
    .skill-grid {
        grid-template-columns: 1fr;
    }
}

/* Floating Back Button */
.floating-back-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    animation: backPulse 2s ease-in-out infinite;
}

.back-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 3px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.back-fab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.back-fab:hover::before {
    transform: translateX(100%);
}

.back-fab:hover {
    transform: translateY(-8px) scale(1.15);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 15px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #4ecdc4 100%);
}

.back-icon {
    font-size: 28px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
    position: relative;
    animation: iconBounce 2s ease-in-out infinite;
}

.back-tooltip {
    position: absolute;
    right: 85px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 107, 107, 0.3);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 140px;
    text-align: center;
}

.back-tooltip::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid rgba(0, 0, 0, 0.95);
}

.back-tooltip::after {
    content: '🏡';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    animation: homeFloat 1s ease-in-out infinite alternate;
}

.back-fab:hover .back-tooltip {
    opacity: 1;
    visibility: visible;
    right: 90px;
}

@keyframes backPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes homeFloat {
    0% {
        transform: translateY(-50%) translateX(0);
    }
    100% {
        transform: translateY(-50%) translateX(3px);
    }
}

/* Responsive adjustments for floating back button */
@media (max-width: 768px) {
    .floating-back-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .back-fab {
        width: 60px;
        height: 60px;
    }
    
    .back-icon {
        font-size: 24px;
    }
    
    .back-tooltip {
        display: none; /* Hide tooltip on mobile */
    }
}