/* Marloth Portal - Projekt-Status Styles */

:root {
    --marloth-primary: #001132;
    --marloth-accent: #45f0c5;
    --marloth-warning: #ffc000;
    --marloth-danger: #dc3545;
    --marloth-secondary: #47243c;
    --marloth-text: #333333;
    --marloth-gray: #666666;
    --marloth-light-gray: #f5f5f5;
    --marloth-border: #e0e0e0;
}

/* ========================================
   PORTAL SIDEBAR
   ======================================== */

.web-sidebar .sidebar-menu a,
.web-sidebar .sidebar-item a,
.web-sidebar .list-unstyled a {
    font-size: 0.95em;
    padding: 8px 0;
    display: block;
    color: var(--marloth-text);
    font-weight: 500;
}

.web-sidebar .sidebar-menu a:hover,
.web-sidebar .sidebar-item a:hover,
.web-sidebar .list-unstyled a:hover {
    color: var(--marloth-primary);
}

.web-sidebar .sidebar-menu li,
.web-sidebar .sidebar-item,
.web-sidebar .list-unstyled li {
    margin-bottom: 0;
}

/* Container */
.projekt-container {
    max-width: 1100px;
    margin: 0;
    padding: 20px;
    background: white;
    font-size: 14px;
}

/* Header */
.projekt-header {
    margin-bottom: 24px;
}

.projekt-header h3 {
    color: var(--marloth-primary);
    margin: 0 0 4px 0;
    font-weight: 600;
    font-size: 1.4em;
}

.projekt-status {
    color: var(--marloth-gray);
    font-size: 0.9em;
}

/* Phasen-Timeline */
.phasen-timeline {
    padding: 20px 0;
    margin-bottom: 24px;
    background: white;
}

.timeline-dots {
    display: flex;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.phase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: pointer;
    transition: opacity 0.2s;
}

.phase-item:hover {
    opacity: 0.8;
}

.phase-item.selected .phase-name {
    color: var(--marloth-primary);
    font-weight: 600;
}

.phase-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--marloth-light-gray);
    border: 2px solid var(--marloth-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--marloth-gray);
    transition: all 0.2s;
}

.phase-dot.completed {
    background: var(--marloth-accent);
    border-color: var(--marloth-accent);
    color: var(--marloth-primary);
}

.phase-dot.active {
    box-shadow: 0 0 0 3px rgba(69, 240, 197, 0.3);
}

.phase-dot svg {
    width: 18px;
    height: 18px;
}

.phase-name {
    font-size: 0.95em;
    color: var(--marloth-text);
    text-align: center;
    margin-top: 10px;
    font-weight: 500;
}

.phase-date {
    font-size: 0.8em;
    color: var(--marloth-gray);
    text-align: center;
    margin-top: 4px;
}

.phase-countdown {
    font-size: 0.75em;
    color: var(--marloth-gray);
    text-align: center;
    margin-top: 2px;
}

/* Progress Section */
.progress-section {
    margin-bottom: 24px;
    padding: 0;
    background: white;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--marloth-text);
}

.progress-percent {
    color: var(--marloth-primary);
    font-weight: 600;
}

.progress {
    background: var(--marloth-light-gray);
    height: 4px !important;
    overflow: hidden;
    border-radius: 0 !important;
}

.progress-bar {
    background: var(--marloth-accent) !important;
    border-radius: 0 !important;
}

/* Tasks Card */
.tasks-card {
    background: white;
    margin-bottom: 24px;
    border: 1px solid var(--marloth-border);
}

.tasks-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--marloth-border);
}

.tasks-header h4 {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--marloth-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tasks-header h4 i {
    margin-right: 8px;
    color: var(--marloth-primary);
}

/* Countdown Text */
.countdown-text {
    color: var(--marloth-gray);
    font-size: 0.85em;
    font-weight: 400;
    margin-left: auto;
}

.countdown-text.warning {
    color: var(--marloth-warning);
}

.countdown-text.overdue {
    color: var(--marloth-danger);
}

.tasks-body {
    padding: 0 16px;
}

/* Task Items */
.task-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item {
    border-bottom: 1px solid var(--marloth-border);
}

.task-item:last-child {
    border-bottom: none;
}

.task-header {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
}

.task-item.completed .task-name {
    color: var(--marloth-gray);
}

.task-check {
    margin-right: 12px;
    font-size: 1.1em;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-check .fa-check-circle {
    color: var(--marloth-accent);
}

.task-check .fa-circle-o,
.task-check .fa-circle-thin {
    color: var(--marloth-border);
}

/* Fallback circle for open tasks */
.task-check .open-circle {
    width: 16px;
    height: 16px;
    border: 2px solid var(--marloth-border);
    border-radius: 50%;
    display: inline-block;
}

.task-name {
    flex-grow: 1;
    color: var(--marloth-text);
    font-size: 0.95em;
}

.task-date-pill {
    background: var(--marloth-light-gray);
    color: var(--marloth-gray);
    padding: 2px 10px;
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 10px;
    white-space: nowrap;
    border: 1px solid var(--marloth-border);
}

.task-toggle {
    color: var(--marloth-gray);
    transition: transform 0.2s;
    margin-left: 10px;
}

.task-item.open .task-toggle {
    transform: rotate(180deg);
}

.task-description {
    display: none;
    padding: 0 0 12px 32px;
    color: var(--marloth-gray);
    font-size: 0.9em;
    line-height: 1.5;
}

.task-item.open .task-description {
    display: block;
}

/* Updates Section */
.updates-section,
.issues-section {
    margin-bottom: 24px;
}

.updates-section h4,
.issues-section h4 {
    color: var(--marloth-text);
    margin-bottom: 14px;
    font-size: 1em;
    font-weight: 600;
}

.updates-section h4 i,
.issues-section h4 i {
    margin-right: 8px;
    color: var(--marloth-gray);
}

.update-card {
    padding: 12px 0;
    border-bottom: 1px solid var(--marloth-border);
}

.update-card:last-child {
    border-bottom: none;
}

.update-header {
    color: var(--marloth-gray);
    font-size: 0.85em;
    margin-bottom: 6px;
}

.update-header span {
    margin-right: 14px;
}

.update-content {
    color: var(--marloth-text);
    font-size: 0.95em;
    line-height: 1.5;
}

/* Issues */
.issue-card {
    padding: 12px 0;
    border-bottom: 1px solid var(--marloth-border);
}

.issue-card:last-child {
    border-bottom: none;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.issue-subject {
    color: var(--marloth-text);
    font-size: 0.95em;
}

.issue-description {
    color: var(--marloth-gray);
    font-size: 0.9em;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 600px) {
    .projekt-container {
        padding: 16px;
    }
    
    .phasen-timeline {
        padding: 16px 0;
    }
    
    .phase-dot {
        width: 38px;
        height: 38px;
    }
    
    .phase-name {
        font-size: 0.85em;
    }
    
    .countdown-pill {
        font-size: 0.75em;
        padding: 2px 8px;
    }
}

/* ========================================
   TAB NAVIGATION
   ======================================== */

.tab-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: none;
}

.tab-btn {
    background: var(--marloth-light-gray);
    border: 1px solid var(--marloth-border);
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--marloth-gray);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 0.9em;
}

.tab-btn:hover {
    background: var(--marloth-border);
    color: var(--marloth-primary);
}

.tab-btn.active {
    background: var(--marloth-primary);
    border-color: var(--marloth-primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   ACTIVITY FEED
   ======================================== */

.aktivitaeten-container {
    padding: 0;
}

/* Comment Input */
.comment-input-section {
    background: white;
    border: 1px solid var(--marloth-border);
    padding: 16px;
    margin-bottom: 24px;
}

.comment-input-section textarea {
    width: 100%;
    border: 1px solid var(--marloth-border);
    padding: 12px;
    font-size: 0.95em;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.comment-input-section textarea:focus {
    outline: none;
    border-color: var(--marloth-accent);
}

.comment-input-section button {
    margin-top: 10px;
    background: var(--marloth-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-input-section button:hover {
    background: #002255;
}

.comment-input-section button:disabled {
    background: var(--marloth-gray);
    cursor: not-allowed;
}

/* Feed Container */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Feed Card */
.feed-card {
    background: white;
    border: 1px solid var(--marloth-border);
    padding: 16px;
    transition: box-shadow 0.2s;
}

.feed-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.feed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.feed-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    flex-shrink: 0;
}

/* Icon Colors by Event Type */
.feed-icon.task {
    background: rgba(69, 240, 197, 0.15);
    color: #00a67e;
}

.feed-icon.milestone {
    background: rgba(255, 192, 0, 0.15);
    color: var(--marloth-warning);
}

.feed-icon.post {
    background: rgba(0, 17, 50, 0.1);
    color: var(--marloth-primary);
}

.feed-icon.email {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.feed-icon.phone {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.feed-icon.comment {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.feed-icon.youtube {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
}

.feed-meta {
    flex: 1;
}

.feed-author {
    font-weight: 600;
    color: var(--marloth-text);
    font-size: 0.95em;
}

.feed-timestamp {
    color: var(--marloth-gray);
    font-size: 0.85em;
}

.feed-action {
    font-size: 0.85em;
    color: var(--marloth-gray);
}

.feed-title {
    font-weight: 600;
    color: var(--marloth-primary);
    margin: 8px 0;
    font-size: 1em;
}

.feed-content {
    color: var(--marloth-text);
    font-size: 0.95em;
    line-height: 1.6;
}

.feed-content p {
    margin: 0 0 8px 0;
}

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

/* YouTube Embed */
.feed-youtube {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 12px 0;
    background: #000;
}

.feed-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Feed Attachments */
.feed-attachments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feed-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--marloth-light-gray);
    border: 1px solid var(--marloth-border);
    font-size: 0.85em;
    color: var(--marloth-text);
    text-decoration: none;
    transition: background 0.2s;
}

.feed-attachment:hover {
    background: var(--marloth-border);
    text-decoration: none;
    color: var(--marloth-text);
}

.feed-attachment i {
    color: var(--marloth-gray);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 24px;
}

.load-more-btn {
    background: white;
    border: 1px solid var(--marloth-border);
    padding: 12px 32px;
    font-size: 0.95em;
    color: var(--marloth-text);
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--marloth-light-gray);
    border-color: var(--marloth-primary);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feed Loading State */
.feed-loading {
    text-align: center;
    padding: 40px;
    color: var(--marloth-gray);
}

.feed-empty {
    text-align: center;
    padding: 40px;
    color: var(--marloth-gray);
    background: var(--marloth-light-gray);
    border: 1px solid var(--marloth-border);
}

/* ========================================
   FEED ITEM COMMENTS
   ======================================== */

.feed-comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--marloth-border);
}

.feed-comments-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--marloth-gray);
    font-size: 0.9em;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.feed-comments-toggle:hover {
    color: var(--marloth-primary);
}

.feed-comments-toggle i {
    font-size: 1em;
}

.feed-comments-list {
    margin-top: 12px;
}

.comments-loading,
.no-comments {
    color: var(--marloth-gray);
    font-size: 0.9em;
    padding: 8px 0;
}

.feed-comment {
    background: var(--marloth-light-gray);
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.feed-comment:last-child {
    margin-bottom: 0;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--marloth-text);
    margin-bottom: 4px;
}

.comment-text {
    font-size: 0.9em;
    color: var(--marloth-text);
    line-height: 1.4;
}

.comment-time {
    font-size: 0.8em;
    color: var(--marloth-gray);
    margin-top: 4px;
}

.feed-comment-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.feed-comment-input textarea {
    flex: 1;
    border: 1px solid var(--marloth-border);
    padding: 8px 12px;
    font-size: 0.9em;
    resize: none;
    font-family: inherit;
    border-radius: 4px;
}

.feed-comment-input textarea:focus {
    outline: none;
    border-color: var(--marloth-accent);
}

.feed-comment-input button {
    background: var(--marloth-primary);
    color: white;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
}

.feed-comment-input button:hover {
    background: #002255;
}

.feed-comment-input button:disabled {
    background: var(--marloth-gray);
    cursor: not-allowed;
}

/* ========================================
   NEW POST SECTION
   ======================================== */

.new-post-section {
    margin-bottom: 16px;
    text-align: center;
}

.btn-new-post {
    background: linear-gradient(135deg, var(--marloth-primary) 0%, #002255 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.3);
}

.btn-new-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.4);
}

.btn-new-post i {
    margin-right: 8px;
}

/* ========================================
   MODAL
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--marloth-border);
    background: var(--marloth-bg-light);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--marloth-primary);
}

.modal-header h3 i {
    margin-right: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    color: var(--marloth-gray);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--marloth-dark);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--marloth-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--marloth-bg-light);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--marloth-dark);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--marloth-border);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--marloth-accent);
}

.post-editor {
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--marloth-border);
    border-radius: 6px;
    font-size: 1em;
    line-height: 1.5;
    overflow-y: auto;
}

.post-editor:focus {
    outline: none;
    border-color: var(--marloth-accent);
}

.post-editor:empty::before {
    content: attr(placeholder);
    color: var(--marloth-gray);
    pointer-events: none;
}

.post-editor img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.upload-placeholder {
    display: inline-block;
    padding: 8px 12px;
    background: var(--marloth-bg-light);
    border-radius: 6px;
    color: var(--marloth-gray);
    margin: 8px 0;
}

.btn-cancel {
    background: #f0f0f0;
    color: var(--marloth-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: var(--marloth-primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #002255;
}

.btn-submit:disabled {
    background: var(--marloth-gray);
    cursor: not-allowed;
}

.btn-submit i {
    margin-right: 6px;
}

/* ========================================
   RESPONSIVE FEED
   ======================================== */

@media (max-width: 600px) {
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .feed-card {
        padding: 12px;
    }
    
    .feed-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9em;
    }
    
    .feed-comment-input {
        flex-direction: column;
    }
    
    .feed-comment-input button {
        align-self: flex-end;
    }
    
    .modal-container {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-overlay {
        padding: 0;
    }
}
