/* AI Interface Styles */
:root {
    --ai-primary: #3498db;
    --ai-secondary: #2ecc71;
    --ai-accent: #e74c3c;
    --ai-background: #f8f9fa;
    --ai-text: #2c3e50;
    --ai-border: #dfe6e9;
    --ai-hover: #f1f2f6;
    --ai-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --ai-gradient: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
}

.ai-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 20px;
    height: calc(100vh - 64px);
    margin-top: 64px;
    padding: 20px;
    background-color: #f8f9fa;
    position: relative;
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

/* Sidebar Styles */
.ai-sidebar {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 104px);
    overflow-y: auto;
}

.ai-welcome {
    padding: 15px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    border-radius: 12px;
    margin-bottom: 10px;
}

.ai-welcome h2 {
    color: #2C3E50;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.ai-welcome p {
    color: #7F8C8D;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 8px;
}

.ai-modes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-modes h3 {
    color: #2C3E50;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: transparent;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    color: #2C3E50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.mode-btn.active {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    border: none;
}

.mode-btn i {
    font-size: 1.2em;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e1e8ed;
}

.current-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #2C3E50;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2ecc71;
    font-size: 0.9em;
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message-content {
    max-width: 80%;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    margin-left: auto;
}

.message-text h3 {
    margin-bottom: 10px;
    color: #2C3E50;
}

.message-text p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 5px;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e8ed;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 8px;
    font-size: 1em;
    color: #2C3E50;
    min-height: 24px;
    max-height: 150px;
}

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

.input-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.action-btn {
    background: transparent;
    border: none;
    color: #7F8C8D;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.action-btn:hover {
    color: #3498db;
}

.send-btn {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
}

/* Context Panel */
.context-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e1e8ed;
}

.context-header h3 {
    color: #2C3E50;
    font-size: 1.2em;
}

.toggle-context {
    background: transparent;
    border: none;
    color: #7F8C8D;
    cursor: pointer;
}

.context-content {
    padding: 20px;
    height: calc(100vh - 165px);
    overflow-y: auto;
}

.context-section {
    margin-bottom: 25px;
}

.context-section h4 {
    color: #2C3E50;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.project-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-label {
    display: block;
    color: #7F8C8D;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    color: #2C3E50;
    font-size: 1.2em;
    font-weight: 500;
}

.resource-list {
    list-style: none;
    padding: 0;
}

.resource-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: #2C3E50;
    cursor: pointer;
    transition: color 0.3s ease;
}

.resource-list li:hover {
    color: #3498db;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.goal-item {
    position: relative;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.goal-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(46, 204, 113, 0.2));
    border-radius: 10px;
    z-index: 0;
}

.goal-item span {
    position: relative;
    z-index: 1;
    color: #2C3E50;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ai-container {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 992px) {
    .ai-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .ai-sidebar {
        height: auto;
        max-height: 300px;
    }

    .context-panel {
        height: auto;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .ai-container {
        padding: 10px;
    }

    .chat-messages {
        padding: 15px;
    }

    .message-content {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .project-stats {
        grid-template-columns: 1fr;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .input-actions {
        flex-direction: row;
        justify-content: space-between;
    }
}
