/* AI Project Manager v2.6.1 - Frontend Styles */
/* Ghost.org Dark Mode Aesthetic with Animated Shimmer Effects */

/* Reset & Base */
.aipm-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0F0F0F;
    color: #FFFFFF;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    margin: 0;
}

/* Sidebar */
.aipm-sidebar {
    width: 280px;
    background: #121212;
    border-right: 1px solid #333333;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.aipm-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #333333;
}

.aipm-logo {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aipm-btn-new-project {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.aipm-btn-new-project:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(156, 39, 176, 0.3);
}

.aipm-btn-icon {
    font-size: 20px;
    font-weight: 700;
}

/* Navigation */
.aipm-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.aipm-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    color: #B0B0B0;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.aipm-nav-item:hover {
    background: #1A1A1A;
    color: #FFFFFF;
}

.aipm-nav-item.active {
    background: #1A1A1A;
    color: #E91E63;
}

.aipm-nav-icon {
    width: 20px;
    height: 20px;
}

/* Sidebar Footer */
.aipm-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #333333;
}

.aipm-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aipm-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #E91E63;
}

.aipm-user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aipm-user-name {
    font-size: 14px;
    font-weight: 600;
}

.aipm-user-role {
    font-size: 12px;
    color: #9E9E9E;
}

/* Main Content */
.aipm-main {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    max-width: 1400px;
}

.aipm-header {
    margin-bottom: 32px;
}

.aipm-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.aipm-subtitle {
    font-size: 16px;
    color: #9E9E9E;
}

/* Tab Content */
.aipm-tab-content {
    display: none;
}

.aipm-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid with Shimmer Animation */
.aipm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.aipm-stat-card {
    background: #1A1A1A;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer Effect */
.aipm-stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.aipm-stat-card:hover {
    border-color: #E91E63;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.2);
}

.aipm-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aipm-stat-icon svg {
    width: 28px;
    height: 28px;
}

.aipm-stat-content {
    flex: 1;
}

.aipm-stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.aipm-stat-label {
    font-size: 14px;
    color: #9E9E9E;
}

/* Infinite Canvas for Activity Points */
.aipm-activity-canvas-container {
    margin-bottom: 40px;
}

.aipm-activity-canvas {
    background: #1A1A1A;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 40px;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.aipm-activity-point {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.aipm-activity-point:hover {
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(233, 30, 99, 0.6);
}

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

/* Projects Grid with Shimmer */
.aipm-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.aipm-project-card {
    background: #1A1A1A;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shimmer Effect on Cards */
.aipm-project-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shimmer 4s infinite;
}

.aipm-project-card:hover {
    border-color: #E91E63;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.2);
}

.aipm-project-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    position: relative;
    z-index: 1;
}

.aipm-project-description {
    font-size: 14px;
    color: #B0B0B0;
    margin: 0 0 16px 0;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.aipm-project-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #9E9E9E;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.aipm-progress-bar {
    height: 6px;
    background: #333333;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.aipm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E91E63 0%, #9C27B0 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Modal Styles */
.aipm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.3s ease;
}

.aipm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aipm-modal-content {
    background: #1A1A1A;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.aipm-modal-header {
    padding: 24px;
    border-bottom: 1px solid #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aipm-modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.aipm-modal-close {
    background: none;
    border: none;
    color: #9E9E9E;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.aipm-modal-close:hover {
    color: #FFFFFF;
}

.aipm-modal-body {
    padding: 24px;
}

.aipm-modal-footer {
    padding: 24px;
    border-top: 1px solid #333333;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Elements */
.aipm-form-group {
    margin-bottom: 20px;
}

.aipm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.aipm-form-group input,
.aipm-form-group textarea {
    width: 100%;
    padding: 12px;
    background: #0F0F0F;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.aipm-form-group input:focus,
.aipm-form-group textarea:focus {
    outline: none;
    border-color: #E91E63;
}

/* Buttons */
.aipm-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.aipm-btn-primary {
    background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
    color: #FFFFFF;
}

.aipm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(156, 39, 176, 0.3);
}

.aipm-btn-secondary {
    background: #333333;
    color: #FFFFFF;
}

.aipm-btn-secondary:hover {
    background: #444444;
}

/* Chat Widget */
.aipm-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.aipm-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%);
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.4);
    transition: all 0.3s ease;
}

.aipm-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(233, 30, 99, 0.5);
}

.aipm-chat-icon {
    width: 28px;
    height: 28px;
}

.aipm-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 500px;
    background: #1A1A1A;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.aipm-chat-window-header {
    padding: 16px;
    border-bottom: 1px solid #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aipm-chat-window-header h3 {
    margin: 0;
    font-size: 16px;
}

.aipm-chat-close {
    background: none;
    border: none;
    color: #9E9E9E;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.aipm-chat-close:hover {
    color: #FFFFFF;
}

.aipm-chat-window-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.aipm-chat-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from { transform: translateX(-10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.aipm-chat-message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
}

.aipm-chat-message-user .aipm-chat-message-content {
    background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
    float: right;
}

.aipm-chat-message-assistant .aipm-chat-message-content {
    background: #333333;
}

.aipm-chat-window-input {
    padding: 16px;
    border-top: 1px solid #333333;
    display: flex;
    gap: 8px;
}

.aipm-chat-window-input input {
    flex: 1;
    padding: 12px;
    background: #0F0F0F;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 14px;
}

.aipm-chat-window-input input:focus {
    outline: none;
    border-color: #E91E63;
}

.aipm-chat-window-input button {
    padding: 12px 16px;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aipm-chat-window-input button:hover {
    transform: scale(1.05);
}

/* Tasks */
.aipm-task-card {
    background: #1A1A1A;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.aipm-task-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shimmer 5s infinite;
}

.aipm-task-card:hover {
    border-color: #E91E63;
    transform: translateY(-2px);
}

.aipm-task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.aipm-task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.aipm-task-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.aipm-task-priority {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.aipm-task-priority.high {
    background: rgba(233, 30, 99, 0.2);
    color: #E91E63;
}

.aipm-task-priority.medium {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

.aipm-task-priority.low {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

/* History Timeline */
.aipm-history-timeline {
    position: relative;
    padding-left: 40px;
}

.aipm-history-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #333333;
}

.aipm-history-item {
    position: relative;
    margin-bottom: 24px;
    padding: 16px;
    background: #1A1A1A;
    border-radius: 12px;
    border: 1px solid #333333;
    transition: all 0.3s ease;
}

.aipm-history-item:hover {
    border-color: #E91E63;
}

.aipm-history-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%);
    border: 3px solid #0F0F0F;
}

/* Empty State */
.aipm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9E9E9E;
}

.aipm-empty-state svg {
    margin-bottom: 16px;
}

.aipm-empty-state h3 {
    margin-bottom: 8px;
    color: #FFFFFF;
}

/* Loading Animation */
.aipm-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(233, 30, 99, 0.3);
    border-top-color: #E91E63;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .aipm-sidebar {
        width: 70px;
    }
    
    .aipm-sidebar-header .aipm-logo,
    .aipm-nav-item span,
    .aipm-btn-new-project span {
        display: none;
    }
    
    .aipm-main {
        margin-left: 70px;
        padding: 20px;
    }
    
    .aipm-chat-window {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 80px;
    }
}
