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

body {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    line-height: 1.6;
    color: #343541;
    background: 
        linear-gradient(180deg, #f5a97f 0%, #d4a574 20%, #c49a6a 40%, #b89060 60%, #a88656 80%, #977c4c 100%),
        linear-gradient(135deg, #ffd4a3 0%, #ffc085 50%, #ffad66 100%);
    background-image: 
        /* Sky gradient */
        linear-gradient(180deg, 
            rgba(255, 220, 177, 0.9) 0%,
            rgba(255, 200, 150, 0.8) 30%,
            rgba(255, 180, 120, 0.7) 60%,
            rgba(200, 150, 100, 0.6) 100%
        ),
        /* Mountain silhouettes */
        radial-gradient(ellipse at 50% 100%, rgba(100, 70, 50, 0.4) 0%, transparent 60%),
        /* Sun/glow effect */
        radial-gradient(circle at 30% 20%, rgba(255, 240, 200, 0.6) 0%, transparent 40%);
    background-size: 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Main Container - Floating Windows */
.main-container {
    position: relative;
    height: 100vh;
    width: 100%;
    padding: 40px;
    padding-bottom: 100px; /* Space for dock */
}

/* Terminal Window - Floating */
.terminal-panel {
    position: absolute;
    left: 5%;
    top: 10%;
    width: 45%;
    max-width: 800px;
    min-width: 500px;
    height: 75vh;
    min-height: 600px;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-panel.minimizing {
    pointer-events: none;
}

.terminal-panel.minimized {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    width: 0 !important;
    height: 0 !important;
}

.terminal-header {
    background: linear-gradient(to bottom, #3a3a3a 0%, #2d2d2d 100%);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 12px 12px 0 0;
    cursor: grab;
    user-select: none;
}

.terminal-header:active {
    cursor: grabbing;
}

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

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.control-dot.red {
    background: #ff5f56;
}

.control-dot.red:hover {
    background: #ff3b30;
}

.control-dot.yellow {
    background: #ffbd2e;
    cursor: pointer;
}

.control-dot.yellow:hover {
    background: #ff9500;
    transform: scale(1.1);
}

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

.control-dot.green:hover {
    background: #34c759;
}

.terminal-title {
    color: #ccc;
    font-size: 0.85rem;
    margin-left: auto;
    font-weight: 500;
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: #d4d4d4;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.terminal-prompt {
    color: #4ec9b0;
    font-weight: 500;
    flex-shrink: 0;
}

.terminal-command {
    color: #ce9178;
}

.terminal-cursor {
    color: #d4d4d4;
    animation: blink-cursor 1s infinite;
}

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

.terminal-output {
    margin-left: 0;
    margin-bottom: 20px;
}

.file-listing {
    margin-top: 8px;
}

.file-item {
    padding: 4px 0;
    color: #4ec9b0;
}

.file-item.dir {
    color: #4ec9b0;
}

/* Project Sections */
.project-section {
    margin-top: 30px;
    margin-bottom: 8px;
}

.project-info {
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    padding: 20px;
    margin: 12px 0 30px 0;
    color: #d4d4d4;
}

.project-info:not(.visible) {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.project-info.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-header {
    margin-bottom: 15px;
}

.project-header h3 {
    color: #4ec9b0;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    background: #0e639c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-info p {
    color: #cccccc;
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #858585;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-links .link {
    color: #4ec9b0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.project-links .link:hover {
    color: #6dd5c4;
    text-decoration: underline;
}

/* Chat Window - Floating */
.chat-panel {
    position: absolute;
    right: 5%;
    top: 15%;
    width: 45%;
    max-width: 800px;
    min-width: 500px;
    height: 75vh;
    min-height: 600px;
    background: #343541;
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                right 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.minimizing {
    pointer-events: none;
}

.chat-panel.minimized {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    width: 0 !important;
    height: 0 !important;
}

/* AI Header */
.ai-header {
    background: linear-gradient(to bottom, #2a2a2a 0%, #202123 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 12px 12px 0 0;
    padding: 12px 0;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.ai-header:active {
    cursor: grabbing;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ai-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: transparent;
    border: 1px solid #4a4a4f;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: #4a4a4f;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Message Groups */
.message-group {
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.message-group.visible {
    opacity: 1;
    transform: translateY(0);
}

.welcome-message {
    opacity: 1;
    transform: translateY(0);
}

.end-message {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #4a4a4f;
}

/* Messages */
.message {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px 0;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #5436da;
}

.ai-message .message-avatar {
    background: #19c37d;
}

.message-content {
    flex: 1;
    color: #ececf1;
    line-height: 1.75;
}

.message-content p {
    margin-bottom: 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: #fff;
    font-weight: 600;
}

.message-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.message-content li {
    margin-bottom: 8px;
}

.message-content em {
    color: #acacbe;
    font-style: normal;
}

.typing-indicator {
    color: #8e8ea0;
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.typing-cursor {
    color: #19c37d;
    animation: blink-cursor 1s infinite;
    margin-left: 2px;
}

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

/* Prompt Container */
.prompt-container {
    background: #343541;
    border-top: 1px solid #4a4a4f;
    padding: 20px;
    flex-shrink: 0;
}

.prompt-box {
    max-width: 100%;
    margin: 0 auto;
}

.prompt-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #40414f;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #565869;
}

.prompt-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
    line-height: 1.5;
}

.prompt-input::placeholder {
    color: #8e8ea0;
}

.prompt-input:focus {
    outline: none;
}

.prompt-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-btn {
    background: #19c37d;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #15a770;
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

.chat-container::-webkit-scrollbar-track {
    background: #343541;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #565869;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .terminal-panel {
        left: 3%;
        width: 48%;
    }
    
    .chat-panel {
        right: 3%;
        width: 48%;
    }
}

@media (max-width: 1024px) {
    .main-container {
        padding: 20px;
        padding-bottom: 100px;
    }

    .terminal-panel,
    .chat-panel {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        width: 100%;
        max-width: 100%;
        min-width: auto;
        height: 50vh;
        min-height: 400px;
        margin-bottom: 20px;
    }
    
    .macos-dock {
        padding-bottom: 5px;
    }
    
    .dock-container {
        padding: 6px 10px;
    }
    
    .dock-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .terminal-body {
        padding: 15px;
        font-size: 0.85rem;
    }

    .project-info {
        padding: 15px;
    }

    .project-header h3 {
        font-size: 1rem;
    }

    .chat-container {
        padding: 15px;
    }

    .message {
        gap: 12px;
        padding: 15px 0;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .message-content {
        font-size: 0.95rem;
    }

    .prompt-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    .project-tags {
        font-size: 0.75rem;
    }

    .tag {
        padding: 3px 8px;
    }

    .project-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* macOS Dock */
.macos-dock {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding-bottom: 10px;
}

.dock-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 8px 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dock-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    user-select: none;
}

.dock-icon:hover {
    transform: scale(1.3) translateY(-10px);
    background: rgba(255, 255, 255, 0.25);
}

.dock-icon.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dock-icon.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.dock-icon.minimized {
    animation: dock-bounce 0.5s ease-out;
}

@keyframes dock-bounce {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.2) translateY(-5px); }
    100% { transform: scale(1) translateY(0); }
}

.dock-separator {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}
