/* ============================================================================
   STATUS CONTEXT MENU STYLES
   ============================================================================ */

/* Main Menu Container */
.status-context-menu {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 340px;
    max-width: 340px;
    display: none;
    position: fixed;
    animation: fadeInScale 0.2s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    .status-context-menu.show {
        display: block;
    }

/* Tab Headers */
.context-menu-tabs {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
    padding-top: 8px;
    position: relative;
}

.tab-button {
    flex: 0 1 auto;
    padding: 14px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

    .tab-button.active {
        color: #007bff;
    }

        .tab-button.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            height: 2px;
            background-color: #007bff;
        }

    .tab-button:hover:not(.active) {
        background-color: #f8f9fa;
    }

/* Three Dots Menu */
.context-menu-dots-inline {
    margin-left: auto;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

    .context-menu-dots-inline:hover {
        background-color: #f0f0f0;
    }

    .context-menu-dots-inline i {
        font-size: 18px;
        color: #666;
    }

/* Context Options Dropdown */
.context-options-dropdown-right {
    position: absolute;
    top: 48px;
    right: 8px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 140px;
}

.context-option-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

    .context-option-item:hover {
        background-color: #f8f9fa;
    }

    .context-option-item i {
        color: #dc3545;
        font-size: 16px;
    }

/* Tab Content */
.context-menu-content {
    padding: 18px;
}

/* Status Tab */
.status-tab-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.update-status-button {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

    .update-status-button:hover {
        background: #0056b3;
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    }

/* Status Dropdown Section */
.status-dropdown-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Custom Dropdown */
.custom-dropdown-wrapper {
    position: relative;
    width: 100%;
}

    .custom-dropdown-wrapper .dropdown-icon {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: #666;
        font-size: 14px;
    }

.status-select {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

    .status-select:hover {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

    .status-select:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
    }

/* Rationale Input Wrapper */
.rationale-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rationale-textbox {
    width: 100%;
    padding: 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    min-height: 100px;
    color: #333;
    transition: all 0.2s ease;
}

    .rationale-textbox:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

    .rationale-textbox.input-error {
        border-color: #dc3545 !important;
        background-color: #fff5f5;
    }

        .rationale-textbox.input-error:focus {
            border-color: #dc3545 !important;
            box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
        }

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #dc3545 !important;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    background: #fff5f5;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
    animation: slideInError 0.3s ease;
}

    .error-message i {
        font-size: 14px;
        color: #dc3545 !important;
    }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

    .action-buttons .btn-icon {
        min-width: 40px;
        height: 40px;
        padding: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: all 0.2s ease;
    }

    .action-buttons .em-c-icon {
        width: 16px;
        height: 16px;
    }

    .action-buttons .btn-icon:hover .em-c-icon {
        transform: scale(1.1);
        transition: transform 0.2s ease;
    }
/* Comment Tab */
.comment-tab-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-textbox {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    min-height: 120px;
    color: #333;
    transition: border-color 0.2s ease;
}

    .comment-textbox:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

/* Status History */
.status-history-container {
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.status-history-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-left: 3px solid #007bff;
    transition: all 0.2s ease;
}

    .status-history-item:hover {
        background: #e9ecef;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .status-history-item:first-child {
        border-left-color: #28a745;
        background: linear-gradient(135deg, #f0fff4 0%, #e8f5e9 100%);
    }

        .status-history-item:first-child:hover {
            background: linear-gradient(135deg, #e8f5e9 0%, #dcedc8 100%);
        }

.status-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.current-badge {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

.status-metadata {
    padding-top: 4px;
    border-top: 1px solid #e0e0e0;
}

    .status-metadata small {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: #666;
    }

    .status-metadata i {
        font-size: 12px;
    }

    .status-metadata .mx-1 {
        margin-left: 4px;
        margin-right: 4px;
    }

.rationale-text {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.show-history-link {
    text-align: center;
    padding: 8px 0;
    margin-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.btn-link-history {
    background: none;
    border: none;
    color: #007bff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-link-history:hover {
        background: #e7f3ff;
        color: #0056b3;
    }

    .btn-link-history i {
        font-size: 14px;
        transition: transform 0.2s ease;
    }

    .btn-link-history:hover i {
        transform: translateY(2px);
    }

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Support */
.em-theme--dark .status-context-menu {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

.em-theme--dark .tab-button {
    color: #aaa;
}

    .em-theme--dark .tab-button.active {
        color: #4da6ff;
    }

        .em-theme--dark .tab-button.active::after {
            background-color: #4da6ff;
        }

.em-theme--dark .context-menu-dots-inline:hover {
    background-color: #404040;
}

.em-theme--dark .context-menu-dots-inline i {
    color: #aaa;
}

.em-theme--dark .context-options-dropdown-right {
    background: #2d2d2d;
    border-color: #404040;
}

.em-theme--dark .context-option-item:hover {
    background-color: #404040;
}

.em-theme--dark .status-label {
    color: #e0e0e0;
}

.em-theme--dark .current-badge {
    background: linear-gradient(135deg, #2d5a8d 0%, #1e4266 100%);
    color: #b3d9ff;
}

.em-theme--dark .status-dropdown-section {
    background: #252525;
    border-color: #404040;
}

.em-theme--dark .status-select,
.em-theme--dark .rationale-textbox,
.em-theme--dark .comment-textbox {
    background: #1a1a1a;
    color: #e0e0e0;
    border-color: #404040;
}

    .em-theme--dark .rationale-textbox.input-error {
        border-color: #ff6b6b !important;
        background-color: #2d1a1a;
    }

        .em-theme--dark .rationale-textbox.input-error:focus {
            border-color: #ff6b6b !important;
            box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
        }

.em-theme--dark .error-message {
    color: #ff6b6b !important;
    background: #2d1a1a;
    border-left-color: #ff6b6b;
}

    .em-theme--dark .error-message i {
        color: #ff6b6b !important;
    }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .status-context-menu {
        min-width: 300px;
        max-width: 340px;
    }
}